10#include <QtCore/QtGlobal>
11#include <QtWidgets/QMdiArea>
12#include <QtWidgets/QMdiSubWindow>
35 idoc::CMultiDocumentManagerBase,
36 istdgui::TRestorableGuiWrap<
37 istdgui::TGuiComponentBase<QMdiArea> > >,
52 I_REGISTER_SUBELEMENT(DocumentSelection);
54 I_REGISTER_SUBELEMENT_INTERFACE(DocumentSelection,
imod::IModel, ExtractSelectionInfo);
55 I_REGISTER_SUBELEMENT_INTERFACE(DocumentSelection,
istd::IChangeable, ExtractSelectionInfo);
56 I_REGISTER_SUBELEMENT_INTERFACE(DocumentSelection,
iprm::IOptionsList, ExtractSelectionInfo);
57 I_ASSIGN(m_documentTemplateCompPtr,
"DocumentTemplate",
"Document template",
true,
"DocumentTemplate");
58 I_ASSIGN(m_showMaximizedAttrPtr,
"ShowViewMaximized",
"At start shows the document view maximized",
false,
true);
59 I_ASSIGN(m_showPathAsTipAttrPtr,
"ShowFilePathAsToolTip",
"if enabled, the current document file path will be shown as tool tip of document tab",
true,
false);
60 I_ASSIGN(m_allowViewRepeatingAttrPtr,
"AllowViewRepeating",
"If enabled, multiple views for the same document are allowed",
false,
true);
61 I_ASSIGN(m_rememberOpenDocumentsParamPtr,
"RememberOpenDocumentsOnExit",
"If enabled, restores open documents from previous session",
false,
"RememberOpenDocumentsOnExit");
62 I_ASSIGN(m_workspaceBackgroundColorAttrPtr,
"WorkspaceBackgroundColor",
"Background color of the MDI workspace",
false,
"");
63 I_ASSIGN(m_defaultCreatedDocumentTypeIdAttrPtr,
"DefaultCreatedDocumentTypeId",
"Type-ID of the document that should be created if the workspace is empty",
false,
"");
118 const QString& filePath,
120 const QByteArray& viewTypeId,
121 QByteArray& documentTypeId,
135 QStringList
GetOpenFilePaths(
const QByteArray* documentTypeIdPtr =
nullptr)
const override;
160 DocumentSelectionInfo();
166 QByteArray GetSelectedOptionId()
const override;
167 int GetSelectedOptionIndex()
const override;
168 bool SetSelectedOptionIndex(
int index)
override;
172 int GetOptionsFlags()
const override;
173 int GetOptionsCount()
const override;
174 QString GetOptionName(
int index)
const override;
175 QString GetOptionDescription(
int index)
const override;
176 QByteArray GetOptionId(
int index)
const override;
177 bool IsOptionEnabled(
int index)
const override;
190 template <
class InterfaceType>
193 return &component.m_documentSelectionInfo;
204 mutable QString m_lastDirectory;
210 QString m_organizationName;
211 QString m_applicationName;
213 bool m_forceQuietClose;
217 I_ATTR(
bool, m_showMaximizedAttrPtr);
218 I_ATTR(
bool, m_showPathAsTipAttrPtr);
219 I_ATTR(
bool, m_allowViewRepeatingAttrPtr);
220 I_ATTR(QString, m_workspaceBackgroundColorAttrPtr);
221 I_ATTR(QByteArray, m_defaultCreatedDocumentTypeIdAttrPtr);
Interface for a provider of the heriarchical commands.
Basic implementation of a template-based multiple document manager.
Provide set of user actions needed to manage documents in MVC (Model View Controller) concept.
Common interface for a document template.
Provide information about different document types.
This class is a Qt-based workspace implementation of a document manager.
void UpdateAllTitles()
Update titles of views or all views of specified document.
void OnGuiDestroyed() override
Called just before GUI is released.
void CloseAllDocuments() override
void OnSaveSettings(QSettings &settings) const override
void OnRetranslate() override
Called when non-GUI elements (like commands) should be retranslated.
int GetDocumentIndexFromWidget(const QWidget &widget) const
Find index of document associated with specified Qt widget.
idocgui::TQtDocumentManagerWrap< idoc::CMultiDocumentManagerBase, istdgui::TRestorableGuiWrap< istdgui::TGuiComponentBase< QMdiArea > > > BaseClass
const ibase::IHierarchicalCommand * GetCommands() const override
Get list of menu commands.
bool QueryDocumentSave(const SingleDocumentData &info, bool *ignoredPtr) override
Query user if this document should be saved.
void OnRestoreSettings(const QSettings &settings) override
void OnTryClose(bool *ignoredPtr=nullptr) override
Called on trying to close application.
void OnGuiCreated() override
Called just after GUI is initialized.
void OnGuiRetranslate() override
Called from widget event filter when GUI should be retranslated.
virtual void CreateConnections()
Creates signal/slot connnections for the implementation.
istd::IChangeable * OpenSingleDocument(const QString &filePath, bool createView, const QByteArray &viewTypeId, QByteArray &documentTypeId, bool beQuiet, bool *ignoredPtr, iproc::IProgressManager *progressManagerPtr) override
Open single document using its file path.
bool eventFilter(QObject *sourcePtr, QEvent *eventPtr) override
void SetActiveView(istd::IPolymorphic *viewPtr) override
Indicate that some view is active now.
void OnEndChanges(const ChangeSet &changeSet) override
Callback function for end change event.
void OnViewsCountChanged()
Called when number of windows changed.
CMultiDocumentWorkspaceGuiComp()
void OnWindowActivated(QMdiSubWindow *window)
void OnViewRegistered(istd::IPolymorphic *viewPtr, const SingleDocumentData &documentData) override
Called after view is registered.
istdgui::IGuiObject * GetViewFromWidget(const QWidget &widget) const
Find view object associated with specified Qt widget.
void OnViewRemoved(istd::IPolymorphic *viewPtr) override
Called before view is removed.
void OnComponentCreated() override
QStringList GetOpenFilePaths(const QByteArray *documentTypeIdPtr=nullptr) const override
Gets open file names.
Wrapper for general functionality of a Qt based document workspace.
Common interface for model objects, that supports Model/Observer design pattern.
This model wrapper provides a simple connection between a concrete istd::IChangeable implementation a...
Interface for objects which can be enabled/disabled.
Constraints of selection from set of possibilities.
Interface allowing to select single option from list of options.
Consume information about progress of some process.
Represent input/output persistence archive.
Set of change flags (its IDs).
Common interface for data model objects, which can be changed.
Common interface to define the hierarchical graph structures.
Implementation of hierarchical command based on QAction from Qt.
Common interface for GUI objects using in component context.
Base class for all Qt GUI componentes.
A wrapper for saving/restoring of GUI component states in the application settings.
This package contains Qt implementations related to Document/View concept.
Document data definition.