/*************************************************************************** mainwindow.h - description ------------------- begin : Sun Mar 26 2000 copyright : (C) 2000 by Alexander Theel email : alex.theel@gmx.net ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef MAINWINDOW_H #define MAINWINDOW_H #include #include "../information/IHistoryListener.h" #include "../information/CInformationElementHistory.h" #include #include #include #include #include #include #include "./dialogs/optionsDialog/optionsdialog.h" #include #include #include #include #include #include #include //#include "qwidgetstack.h" #include "./cactusbar/CCactusBar.h" #include #include "./editor/CSingleEntryView.h" #include "./editor/editor.h" #include "CTree.h" #include #include #include #include #include #include "../information/CInformationCollection.h" #include "../CTuxCardsConfiguration.h" #include "./recentFileList/RecentFileList.h" #include "./dialogs/passwdDialog/CPasswdDialog.h" #include class MainWindow : public QMainWindow, public IHistoryListener { Q_OBJECT private: CInformationCollection* mpCollection; QMenuBar* mpMenu; OptionsDialog* mpOptionsDialog; CTuxCardsConfiguration& mConfiguration; CCactusBar* mpCactusBar; QSplitter* mpSplit; QValueList* lst; CTree* mpTree; CSingleEntryView* mpSingleEntryView; Editor* mpEditor; QToolBar* mpQuickLoader; RecentFileList* mpRecentFiles; QStatusBar* mpStatusBar; QLabel* statusBar_ChangeLabel; QDialog* showDialog; // a dialog QLabel* showLabel; // the label of the 'show'-dialog, to change it // whenever we want to bool CHANGES; // states whether or not -> changes are done (for saving) int TIMER_ID; void lowMemoryExit( void ); void checkPointer( void* pPointer ); void settingUpActions( void ); void settingUpMenu( void ); void settingUpToolBar( void ); void settingUpStatusBar( void ); void settingUpCactusBar( QWidget* pParent ); void settingUpEditor( QWidget* pParent ); void settingUpTree( QWidget* pParent ); void setWindowGeometry( int,int, int,int ); void settingUpQuickLoader( void ); QComboBox* pComboListStyle; QComboBox* pComboFont; QComboBox* pComboSize; QToolButton* textFormatTool; QToolButton* textBoldTool; QToolButton* textItalicTool; QToolButton* textUnderTool; QToolButton* textColorTool; QToolButton* textLeftTool; QToolButton* textCenterTool; QToolButton* textRightTool; QToolButton* textBlockTool; QToolButton* mpLeftButton; QToolButton* mpRightButton; QToolButton* mpLockButton; QToolButton* mpRemoveLockButton; // actions QAction* editUndoAction; QAction* editRedoAction; QAction* editCopyAction; int askForSaving(QString question); void initializingCollection(QString dataFileName); void callingExecutionStatement(); CInformationElementHistory mHistory; CPasswdDialog mPasswdDialog; QToolBar* mpMainTools; QToolBar* mpEntryTools; QToolBar* mpEditorTools; int miMainToolBarID; int miEntryToolBarID; int miEditorToolBarID; CInformationElement* getActiveIE(); void showDonationMsg(); private slots: void textListStyle(int); void textFontFamily( const QString &f ); void textFontSize( const QString &p ); void textBold(); void textItalic(); void textUnder(); void textColor(); void textLeft(); void textHCenter(); void textRight(); void textBlock(); void changeInformationFormat(); void textFontChanged(const QFont &f); void textColorChanged(const QColor &c); void textAlignmentChanged(int); void showRecognizedFormat(InformationFormat format); void editConfiguration(); void applyConfiguration(); void wordCount(); void insertCurrentDate(); void insertCurrentTime(); void activatePreviousHistoryElement( void ); void activateNextHistoryElement( void ); // debug slots void debugShowRTFTextSource(); void debugShowXMLCode(); // void saveActiveEntry(); void quicklyLoad(Path*); void search(); void print(); void moveElementUp(); void moveElementDown(); void encryptActiveEntry(); void removeEncryptionFromActiveEntry(); void adjustEncryptionButtons(); void addElementToBookmarksEvent(); void slotSaveAndLoadNewFile(QString newFile); void activeInformationElementChanged(CInformationElement*); void toggleMainToolbarVisability(); void toggleEntryToolbarVisability(); void toggleEditorToolbarVisability(); void setMainToolbarVisible( bool bVisible ); void setEntryToolbarVisible( bool bVisible ); void setEditorToolbarVisible( bool bVisible ); public: MainWindow(QString arg); ~MainWindow(); // ************* IHistoryListener ****************** virtual void historyStatusChanged( bool bHasPreviousElement, bool bHasNextElement ); public slots: void showMessage(QString, int seconds); // menucalls void clearAll(); void open(); bool open(QString fileName); void save(); void save(QString); void saveAs(); void exportHTML(); void exit(); void showAbout(); void selectLastActiveElement( void ); void makeVisible( SearchPosition* pPosition ); virtual void keyPressEvent( QKeyEvent* ); protected: int getDataFileFormat( QString fileName ); bool openOldDataFile( QString fileName ); bool openXMLDataFile( QString fileName ); virtual void closeEvent( QCloseEvent *e ); void timerEvent( QTimerEvent* ); void checkFirstTime( void ); protected slots: void recognizeChanges( void ); // to keep track of changes }; #endif