File indexing completed on 2024-05-12 16:40:16
0001 /** This file is part of the KDE project 0002 * 0003 * Copyright (C) 2011 Adam Pigg <adam@piggz.co.uk> 0004 * 0005 * This library is free software; you can redistribute it and/or 0006 * modify it under the terms of the GNU Library General Public 0007 * License as published by the Free Software Foundation; either 0008 * version 2 of the License, or (at your option) any later version. 0009 * 0010 * This library is distributed in the hope that it will be useful, 0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0013 * Library General Public License for more details. 0014 * 0015 * You should have received a copy of the GNU Library General Public License 0016 * along with this library; see the file COPYING.LIB. If not, write to 0017 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0018 * Boston, MA 02110-1301, USA. 0019 */ 0020 0021 #ifndef KEXIMOBILE_H 0022 #define KEXIMOBILE_H 0023 0024 #include <core/KexiMainWindowIface.h> 0025 0026 #include <QUrl> 0027 #include <QMainWindow> 0028 0029 class KexiMobileToolbar; 0030 class QHBoxLayout; 0031 class KexiMobileWidget; 0032 0033 class KexiMobileMainWindow : public QMainWindow, public KexiMainWindowIface 0034 { 0035 Q_OBJECT 0036 public: 0037 KexiMobileMainWindow(); 0038 virtual ~KexiMobileMainWindow(); 0039 0040 public Q_SLOTS: 0041 0042 KexiWindow* openObject(KexiPart::Item* item); 0043 0044 //KexiMainWindowIface Overrides 0045 virtual void acceptProjectClosingRequested(bool *cancel); 0046 virtual void acceptPropertySetEditing(); 0047 virtual KActionCollection* actionCollection() const; 0048 void addSearchableModel(KexiSearchableModel *model) ; 0049 void removeSearchableModel(KexiSearchableModel *model) override; 0050 virtual void addToolBarAction(const QString& toolBarName, QAction* action); 0051 virtual QList< QAction* > allActions() const; 0052 virtual void appendWidgetToToolbar(const QString& name, QWidget* widget); 0053 virtual void beforeProjectClosing(); 0054 virtual tristate closeObject(KexiPart::Item* item); 0055 virtual tristate closeWindow(KexiWindow* window); 0056 virtual KexiWindow* currentWindow() const; 0057 virtual tristate executeCustomActionForObject(KexiPart::Item* item, const QString& actionName); 0058 virtual QWidget* focusWidget() const; 0059 virtual tristate getNewObjectInfo(KexiPart::Item* partItem, KexiPart::Part* part, 0060 bool *allowOverwriting, const QString& messageWhenAskingForName = QString()); 0061 virtual void highlightObject(const QString& mime, const QString& name); 0062 virtual bool newObject(KexiPart::Info* info, bool *openingCancelled); 0063 virtual KexiWindow* openObject(KexiPart::Item* item, Kexi::ViewMode viewMode, bool *openingCancelled, QMap< QString, QVariant >* staticObjectArgs = 0, QString* errorMessage = 0); 0064 virtual KexiWindow* openObject(const QString& mime, const QString& name, Kexi::ViewMode viewMode, bool *openingCancelled, QMap< QString, QVariant >* staticObjectArgs = 0); 0065 virtual tristate printItem(KexiPart::Item* item); 0066 virtual tristate printPreviewForItem(KexiPart::Item* item); 0067 virtual KexiProject* project(); 0068 virtual void projectClosed(); 0069 virtual void propertySetSwitched(KexiWindow* window, bool force = false, bool preservePrevSelection = true, bool sortedProperties = false, const QByteArray& propertyToSelect = QByteArray()); 0070 virtual void registerChild(KexiWindow* window); 0071 virtual tristate saveObject(KexiWindow* window, const QString& messageWhenAskingForName = QString(), bool dontAsk = false); 0072 virtual tristate saveObject(KexiWindow*, const QString&, KexiMainWindowIface::SaveObjectOptions); 0073 virtual void setWidgetVisibleInToolbar(QWidget* widget, bool visible); 0074 virtual tristate showPageSetupForItem(KexiPart::Item* item); 0075 virtual void slotObjectRenamed(const KexiPart::Item& item, const QString& oldName); 0076 virtual tristate switchToViewMode(KexiWindow& window, Kexi::ViewMode viewMode); 0077 virtual KToolBar* toolBar(const QString& name) const; 0078 virtual void updatePropertyEditorInfoLabel(const QString& textToDisplayForNullSet = QString()); 0079 virtual KexiUserFeedbackAgent* userFeedbackAgent() const; 0080 virtual bool userMode() const; 0081 0082 0083 public Q_SLOTS: 0084 void slotOpenDatabase(); 0085 0086 private: 0087 KexiMobileWidget *m_mobile; 0088 KexiMobileToolbar *m_toolbar; 0089 QAction *m_openFileAction; 0090 KexiProject *m_project; 0091 QHBoxLayout *m_layout; 0092 0093 void setupToolbar(); 0094 0095 KexiProject* openProject(const QUrl &url); 0096 bool openingAllowed(KexiPart::Item* item, Kexi::ViewMode viewMode, QString* errorMessage); 0097 }; 0098 0099 #endif // KEXIMOBILE_H