CSingleDocumentWorkspaceGuiComp.h
Go to the documentation of this file.
1 #ifndef iqtdoc_CSingleDocumentWorkspaceGuiComp_included
2 #define iqtdoc_CSingleDocumentWorkspaceGuiComp_included
3 
4 
5 // Qt includes
6 #include <QtCore/QtGlobal>
7 #if QT_VERSION >= 0x050000
8 #include <QtWidgets/QWidget>
9 #else
10 #include <QtGui/QWidget>
11 #endif
12 
13 // ACF includes
15 #include <idoc/IDocumentTemplate.h>
17 
21 
23 
24 
25 namespace iqtdoc
26 {
27 
28 
34  idoc::CSingleDocumentManagerBase,
35  iqtgui::TRestorableGuiWrap<
36  iqtgui::TGuiComponentBase<QWidget> > >
37 {
38  Q_OBJECT
39 
40 public:
45 
46  I_BEGIN_COMPONENT(CSingleDocumentWorkspaceGuiComp);
47  I_REGISTER_INTERFACE(idoc::IDocumentManager);
48  I_ASSIGN(m_documentTemplateCompPtr, "DocumentTemplate", "Document template", true, "DocumentTemplate");
49  I_ASSIGN(m_rememberOpenDocumentParamPtr, "RememberOpenDocumentOnExit", "If enabled, restores open document from previous session", false, "RememberOpenDocumentOnExit");
50  I_END_COMPONENT;
51 
52  enum GroupId
53  {
54  GI_WINDOW = 0x300,
57  };
58 
60 
61  // reimplemented (iqtgui::IGuiObject)
62  virtual void OnTryClose(bool* ignoredPtr = NULL);
63 
64 protected:
68  void UpdateTitle();
69 
70  // reimplemented (idoc::CSingleDocumentManagerBase)
71  virtual QString GetOpenFilePath(const QByteArray* documentTypeIdPtr = NULL) const;
72  virtual void OnViewRegistered(istd::IPolymorphic* viewPtr);
73  virtual void OnViewRemoved(istd::IPolymorphic* viewPtr);
74  virtual bool QueryDocumentSave(bool* ignoredPtr);
75 
76  // reimplemented (iqt:CGuiComponentBase)
77  virtual void OnGuiCreated();
78  virtual void OnGuiDestroyed();
79 
80  // reimplemented (icomp::CComponentBase)
81  virtual void OnComponentCreated();
82 
83  // reimplemented (istd:IChangeable)
84  virtual void OnEndChanges(const ChangeSet& changeSet);
85 
86  // reimplemented (TRestorableGuiWrap)
87  virtual void OnRestoreSettings(const QSettings& settings);
88 
89 private:
90  I_REF(idoc::IDocumentTemplate, m_documentTemplateCompPtr);
91  I_REF(iprm::IEnableableParam, m_rememberOpenDocumentParamPtr);
92 
93  iqtgui::IGuiObject* m_lastViewPtr;
94 
95  QString m_organizationName;
96  QString m_applicationName;
97 };
98 
99 
100 } // namespace iqtdoc
101 
102 
103 #endif // !iqtdoc_CSingleDocumentWorkspaceGuiComp_included
104 
virtual bool QueryDocumentSave(bool *ignoredPtr)
Query user if this document can be closed.
virtual void OnEndChanges(const ChangeSet &changeSet)
Callback function for end change event.
virtual void OnViewRegistered(istd::IPolymorphic *viewPtr)
Called after view is registered.
virtual void OnTryClose(bool *ignoredPtr=NULL)
Called on trying to close application.
Basic implementation of a template-based single document manager.
virtual void OnRestoreSettings(const QSettings &settings)
Qt-based workspace implementation of a single document manager.
A wrapper for saving/restoring of GUI component states in the application settings.
Interface for objects which can be enabled/disabled.
Base interface for all used interfaces and implementations.
Definition: IPolymorphic.h:17
Wrapper for general functionality of a Qt based document workspace.
Provide set of user actions needed to manage documents in MVC (Model View Controller) concept...
Common interface for a document template.
virtual void OnViewRemoved(istd::IPolymorphic *viewPtr)
Called before view is removed.
Common interface for GUI objects using in component context.
Definition: IGuiObject.h:25
void UpdateTitle()
Update titles of views or all views of specified document.
#define NULL
Definition: istd.h:64
iqtdoc::TQtDocumentManagerWrap< idoc::CSingleDocumentManagerBase, iqtgui::TRestorableGuiWrap< iqtgui::TGuiComponentBase< QWidget > > > BaseClass
virtual void OnGuiDestroyed()
Called just before GUI is released.
virtual QString GetOpenFilePath(const QByteArray *documentTypeIdPtr=NULL) const
Gets open file names.
virtual void OnGuiCreated()
Called just after GUI is initialized.

© 2007-2017 Witold Gantzke and Kirill Lepskiy