Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / vcl / abstdlg.hxx
blob5303165f2e9bd6e829923ebc01565413a6e63b53
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_VCL_ABSTDLG_HXX
20 #define INCLUDED_VCL_ABSTDLG_HXX
22 #include <rtl/ustring.hxx>
23 #include <tools/link.hxx>
24 #include <vcl/dllapi.h>
25 #include <vcl/vclptr.hxx>
26 #include <vcl/vclreferencebase.hxx>
27 #include <vector>
29 namespace vcl { class Window; }
30 class Dialog;
31 class Bitmap;
33 /**
34 * Some things multiple-inherit from VclAbstractDialog and OutputDevice,
35 * so we need to use virtual inheritance to keep the referencing counting
36 * OK.
38 class VCL_DLLPUBLIC VclAbstractDialog : public virtual VclReferenceBase
40 protected:
41 virtual ~VclAbstractDialog() override;
42 public:
43 virtual short Execute() = 0;
45 // Screenshot interface
46 virtual std::vector<OString> getAllPageUIXMLDescriptions() const;
47 virtual bool selectPageByUIXMLDescription(const OString& rUIXMLDescription);
48 virtual Bitmap createScreenshot() const;
49 virtual OString GetScreenshotId() const { return OString(); };
52 class VCL_DLLPUBLIC VclAbstractDialog2 : public virtual VclReferenceBase
54 protected:
55 virtual ~VclAbstractDialog2() override;
56 public:
57 virtual void StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl ) = 0;
58 virtual long GetResult() = 0;
61 class VCL_DLLPUBLIC VclAbstractTerminatedDialog : public VclAbstractDialog
63 protected:
64 virtual ~VclAbstractTerminatedDialog() override = default;
65 public:
66 virtual void EndDialog(long nResult) = 0;
69 class VCL_DLLPUBLIC VclAbstractRefreshableDialog : public VclAbstractDialog
71 protected:
72 virtual ~VclAbstractRefreshableDialog() override = default;
73 public:
74 virtual void Update() = 0;
77 class VCL_DLLPUBLIC AbstractPasswordToOpenModifyDialog : public VclAbstractDialog
79 protected:
80 virtual ~AbstractPasswordToOpenModifyDialog() override = default;
81 public:
82 virtual OUString GetPasswordToOpen() const = 0;
83 virtual OUString GetPasswordToModify() const = 0;
84 virtual bool IsRecommendToOpenReadonly() const = 0;
87 class VCL_DLLPUBLIC AbstractScreenshotAnnotationDlg : public VclAbstractDialog
89 protected:
90 virtual ~AbstractScreenshotAnnotationDlg() override = default;
93 class VCL_DLLPUBLIC VclAbstractDialogFactory
95 public:
96 virtual ~VclAbstractDialogFactory(); // needed for export of vtable
97 static VclAbstractDialogFactory* Create();
98 // The Id is an implementation detail of the factory
99 virtual VclPtr<VclAbstractDialog> CreateVclDialog(vcl::Window* pParent, sal_uInt32 nId) = 0;
101 // creates instance of PasswordToOpenModifyDialog from cui
102 virtual VclPtr<AbstractPasswordToOpenModifyDialog> CreatePasswordToOpenModifyDialog( vcl::Window * pParent, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify ) = 0;
104 // creates instance of ScreenshotAnnotationDlg from cui
105 virtual VclPtr<AbstractScreenshotAnnotationDlg> CreateScreenshotAnnotationDlg(
106 vcl::Window* pParent,
107 Dialog& rParentDialog) = 0;
110 #endif
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */