summaryrefslogtreecommitdiffstats
path: root/kpovmodeler/pmshell.h
blob: c21a51adf70b19187ddbf4380d4d46d3bf7c6be9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
/*
**************************************************************************
                                 description
                             --------------------
    copyright            : (C) 2000-2003 by Andreas Zehender
    email                : zehender@kde.org
**************************************************************************

**************************************************************************
*                                                                        *
*  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 PMSHELL_H
#define PMSHELL_H

#include "pmdockwidget.h"

#include "pmpart.h"
#include "pmglview.h"
#include "version.h"

#include <tqptrlist.h>

//class KHelpMenu;
class KStatusBar;
class TDEListAction;
class TDEToggleAction;
class TDESelectAction;
class TDERecentFilesAction;
class TDEActionMenu;
class PMViewOptions;

/**
 * Main view for KPovModeler
 */
class PMShell : public PMDockMainWindow
{
   Q_OBJECT
  

public:
   /**
    * Standard constructor
    */
   PMShell( const KURL& = KURL( ) );
   /**
    * Destructor
    */
   virtual ~PMShell( );

   /**
    * Creates the actions
    */
   void setupActions( );
   /**
    * Creates the docking views
    */
   void setupView( );
   /**
    * Updates the gui (menus and toolbars)
    */
   void updateGUI( );

   /**
    * Checks if a file with that name exists and asks if
    * it should be overwritten.
    *
    * Returns true if the files is not a local file, the file does'n exist
    * or the file should be overwritten.
    */
   static bool overwriteURL( const KURL& u );

public slots:
   void openURL( const KURL& );
   void slotOpenRecent( const KURL& );
   void slotOpenRecentTimer( );

   void slotFileNew( );
   void slotFileOpen( );
   void slotFileSave( );
   void slotFileSaveAs( );
   void slotFileRevert( );
   void slotFilePrint( );
   void slotFileNewWindow( );
   void slotFileClose( );

   void slotShowToolbar( );
   void slotShowStatusbar( );
   void slotShowPath( );
   void slotConfigureKeys( );
   void slotConfigureToolbars( );
   void slotSettings( );
   void slotNewToolbarConfig( );

   void slotNewGraphicalView( PMGLView::PMViewType );
   void slotNewTopView( );
   void slotNewBottomView( );
   void slotNewLeftView( );
   void slotNewRightView( );
   void slotNewFrontView( );
   void slotNewBackView( );
   void slotNewCameraView( );
   void slotNewTreeView( );
   void slotNewDialogView( );
   void slotNewLibraryBrowserView( );

   void saveOptions( );
   void restoreOptions( );

   void setCaption( const TQString& caption = TQString() );
   void statusMsg( const TQString& text = TQString() );
   void slotControlPointMsg( const TQString& msg = TQString() );

   void slotModified( );
   void slotDockWidgetClosed( );
   void slotDeleteClosedObjects( );
   void slotSelectedLayout( int id );
   void slotSaveViewLayout( );
   void slotViewsMenuAboutToShow( );

protected:
   virtual bool queryClose( );
	virtual void showEvent( TQShowEvent* );
	void saveAs( );

public:
   /**
    * Creates a dock widget of view type t with custom config c.
    *
    * If initPosition is true, the widget is docked to the desktop.
    */
   PMDockWidget* createView( const TQString& t, PMViewOptions* c = 0,
                             bool initPosition = true );
   //PMDockWidget* createTreeView( );
   //PMDockWidget* createDialogView( );
   //PMDockWidget* create3DView( PMGLView::PMViewType );

private:
   TDERecentFilesAction* m_pRecent;
   TDEToggleAction* m_pToolbarAction;
   TDEToggleAction* m_pStatusbarAction;
   TDEToggleAction* m_pPathAction;

   TDEAction* m_pNewTreeViewAction;
   TDEAction* m_pNewDialogViewAction;
   TDEAction* m_pNewTopViewAction;
   TDEAction* m_pNewBottomViewAction;
   TDEAction* m_pNewLeftViewAction;
   TDEAction* m_pNewRightViewAction;
   TDEAction* m_pNewFrontViewAction;
   TDEAction* m_pNewBackViewAction;
   TDEAction* m_pNewCameraViewAction;
   TDEAction* m_pNewLibraryBrowserAction;

   TDEActionMenu* m_pViewLayoutsAction;
   TDEAction* m_pSaveViewLayoutAction;

   KStatusBar* m_pStatusBar;
   PMPart* m_pPart;
   KURL m_openRecentURL;

   TQPtrList<TQObject> m_objectsToDelete;
   int m_viewNumber;
};

#endif