• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

okteta

  • sources
  • kde-4.12
  • kdesdk
  • okteta
  • mobile
  • program
mobile/program/mainwindow.cpp
Go to the documentation of this file.
1 /*
2  This file is part of the Okteta Mobile program, made within the KDE community.
3 
4  Copyright 2006-2010 Friedrich W. H. Kossebau <kossebau@kde.org>
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License as
8  published by the Free Software Foundation; either version 2 of
9  the License or (at your option) version 3 or any later version
10  accepted by the membership of KDE e.V. (or its successor approved
11  by the membership of KDE e.V.), which shall act as a proxy
12  defined in Section 14 of version 3 of the license.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
23 #include "mainwindow.h"
24 
25 // program
26 #include "program.h"
27 // tools
28 // #include <stringsextract/stringsextracttoolview.h>
29 // #include <stringsextract/stringsextracttool.h>
30 // #include <info/infotoolview.h>
31 // #include <info/infotool.h>
32 // #include <filter/filtertoolview.h>
33 // #include <filter/filtertool.h>
34 // #include <checksum/checksumtoolview.h>
35 // #include <checksum/checksumtool.h>
36 // #include <info/documentinfotoolview.h>
37 // #include <info/documentinfotool.h>
38 // #include <poddecoder/poddecodertoolview.h>
39 // #include <poddecoder/poddecodertool.h>
40 // #include <bytetable/bytetabletoolview.h>
41 // #include <bytetable/bytetabletool.h>
42 // #include <bookmarks/bookmarkstoolview.h>
43 // #include <bookmarks/bookmarkstool.h>
44 // #include <structures/structtoolview.h>
45 // #include <structures/structtool.h>
46 // Kasten tools
47 // #include <document/versionview/versionviewtoolview.h>
48 // #include <document/versionview/versionviewtool.h>
49 // controllers
50 // #include <overwriteonly/overwriteonlycontroller.h>
51 // #include <overwritemode/overwritemodecontroller.h>
52 // #include <gotooffset/gotooffsetcontroller.h>
53 // #include <selectrange/selectrangecontroller.h>
54 // #include <search/searchcontroller.h>
55 // #include <replace/replacecontroller.h>
56 // #include <bookmarks/bookmarkscontroller.h>
57 // #include <print/printcontroller.h>
58 // #include <viewconfig/viewconfigcontroller.h>
59 // #include <viewmode/viewmodecontroller.h>
60 // #include <viewstatus/viewstatuscontroller.h>
61 // Mobile Kasten controllers
62 // #include <document/readonly/readonlycontroller.h>
63 // #include <documentsystem/creator/creatorcontroller.h>
64 #include <documentsystem/loader/loaderactioncontroller.h>
65 // #include <documentsystem/close/closecontroller.h>
66 // #include <io/setremote/setremotecontroller.h>
67 // #include <io/synchronize/synchronizecontroller.h>
68 // #include <io/clipboard/clipboardcontroller.h>
69 // #include <io/insert/insertcontroller.h>
70 // #include <io/copyas/copyascontroller.h>
71 // #include <io/export/exportcontroller.h>
72 // #include <view/version/versioncontroller.h>
73 // #include <view/zoom/zoomcontroller.h>
74 // #include <view/zoom/zoombarcontroller.h>
75 // #include <view/select/selectcontroller.h>
76 // #include <shellwindow/switchview/switchviewcontroller.h>
77 // #include <shellwindow/viewlistmenu/viewlistmenucontroller.h>
78 // #include <shellwindow/viewareasplit/viewareasplitcontroller.h>
79 #include <shellwindow/toollistmenu/toollistmenucontroller.h>
80 // #include <shellwindow/fullscreen/fullscreencontroller.h>
81 /*#include <viewsystem/close/closecontroller.h>*/
82 // Kasten gui
83 // #include <viewmanager.h>
84 // #include <tabbedviews.h>
85 // #include <multiviewareas.h>
86 // #include <statusbar.h>
87 // Kasten core
88 // #include <documentcreatemanager.h>
89 // #include <documentsyncmanager.h>
90 #include <documentmanager.h>
91 // KDE
92 #include <KMenuBar>
93 #include <KGlobal>
94 #include <KConfigGroup>
95 
96 
97 namespace Kasten2
98 {
99 
100 static const char LoadedUrlsKey[] = "LoadedUrls";
101 
102 OktetaMainWindow::OktetaMainWindow( OktetaProgram *program )
103  : MobileShellWindow( program->documentManager()/*, program->viewManager()*/ ), mProgram( program )
104 {
105  setObjectName( QLatin1String("Shell") );
106 
107 // setStatusBar( new Kasten2::StatusBar(this) );
108 
109  setupControllers();
110 // setupGUI();
111 
112  // all controllers which use plugActionList have to do so after(!) setupGUI() or their entries will be removed
113  // TODO: why is this so?
114  addActionController( new ToolListMenuController(/*this,this*/) );
115 // addXmlGuiController( new ViewListMenuController(mProgram->viewManager(),mGroupedViews,this) );
116 }
117 
118 void OktetaMainWindow::setupControllers()
119 {
120  // general, part of Kasten
121 // addXmlGuiController( new CreatorController(mProgram->viewManager(),mProgram->documentManager(),this) );
122  addActionController( new LoaderActionController(mProgram->documentManager()->syncManager(),menuBar()) );
123 #if 0
124  addXmlGuiController( new SetRemoteController(mProgram->documentManager()->syncManager(),this) );
125  addXmlGuiController( new SynchronizeController(mProgram->documentManager()->syncManager(),this) );
126  addXmlGuiController( new ExportController(mProgram->viewManager(),mProgram->documentManager(),this) );
127  addXmlGuiController( new CloseController(mProgram->documentManager(),this) );
128  addXmlGuiController( new VersionController(this) );
129  addXmlGuiController( new ReadOnlyController(this) );
130  addXmlGuiController( new SwitchViewController(mGroupedViews,this) );
131  addXmlGuiController( new ViewAreaSplitController(mProgram->viewManager(),mGroupedViews,this) );
132  addXmlGuiController( new FullScreenController(this) );
133  addXmlGuiController( new QuitController(0,this) );
134 
135  addXmlGuiController( new ZoomController(this) );
136  addXmlGuiController( new SelectController(this) );
137  addXmlGuiController( new ClipboardController(this) );
138  addXmlGuiController( new InsertController(mProgram->viewManager(),mProgram->documentManager(),this) );
139  addXmlGuiController( new CopyAsController(mProgram->viewManager(),mProgram->documentManager(),this) );
140 
141  addTool( new FileSystemBrowserToolView(new FileSystemBrowserTool( mProgram->documentManager() )) );
142  addTool( new DocumentsToolView(new DocumentsTool( mProgram->documentManager() )) );
143  addTool( new TerminalToolView(new TerminalTool( mProgram->documentManager() )) );
144 #ifndef NDEBUG
145  addTool( new VersionViewToolView(new VersionViewTool()) );
146 #endif
147 
148  // Okteta specific
149 // addXmlGuiController( new OverwriteOnlyController(this) );
150  addXmlGuiController( new OverwriteModeController(this) );
151  addXmlGuiController( new SearchController(this,this) );
152  addXmlGuiController( new ReplaceController(this,this) );
153  addXmlGuiController( new GotoOffsetController(mGroupedViews,this) );
154  addXmlGuiController( new SelectRangeController(mGroupedViews,this) );
155  addXmlGuiController( new BookmarksController(this) );
156  addXmlGuiController( new PrintController(this) );
157  addXmlGuiController( new ViewConfigController(this) );
158  addXmlGuiController( new ViewModeController(this) );
159 
160  Kasten2::StatusBar* bottomBar = static_cast<Kasten2::StatusBar*>( statusBar() );
161  addXmlGuiController( new ViewStatusController(bottomBar) );
162  addXmlGuiController( new ModifiedBarController(bottomBar) );
163  addXmlGuiController( new ReadOnlyBarController(bottomBar) );
164  addXmlGuiController( new ZoomBarController(bottomBar) );
165 
166  addTool( new DocumentInfoToolView(new DocumentInfoTool(mProgram->documentManager()->syncManager())) );
167  addTool( new ChecksumToolView(new ChecksumTool()) );
168  addTool( new FilterToolView(new FilterTool()) );
169  addTool( new StringsExtractToolView(new StringsExtractTool()) );
170  addTool( new ByteTableToolView(new ByteTableTool()) );
171  addTool( new InfoToolView(new InfoTool()) );
172  addTool( new PODDecoderToolView(new PODDecoderTool()) );
173  addTool( new StructToolView(new StructTool()) );
174  addTool( new BookmarksToolView(new BookmarksTool()) );
175 #endif
176 }
177 
178 void OktetaMainWindow::saveProperties( KConfigGroup &configGroup )
179 {
180 #if 0
181  const QStringList urls = mDocumentManager->urls();
182  configGroup.writePathEntry( LoadedUrlsKey, urls );
183 #endif
184 }
185 
186 void OktetaMainWindow::readProperties( const KConfigGroup &configGroup )
187 {
188 #if 0
189  const QStringList urls = configGroup.readPathEntry( LoadedUrlsKey, QStringList() );
190 
191  DocumentSyncManager* syncManager = mDocumentManager->syncManager();
192  DocumentCreateManager* createManager = mDocumentManager->createManager();
193  for( int i=0; i<urls.count(); ++i )
194  {
195  if( urls[i].isEmpty() )
196  createManager->createNew();
197  else
198  syncManager->load( urls[i] );
199  // TODO: set view to offset
200  // if( offset != -1 )
201  }
202 #endif
203 }
204 
205 
206 OktetaMainWindow::~OktetaMainWindow() {}
207 
208 }
Kasten2::ByteTableTool
Definition: bytetabletool.h:44
Kasten2::SelectRangeController
Definition: selectrangecontroller.h:45
Kasten2::VersionViewTool
Definition: versionviewtool.h:37
Kasten2::LoaderActionController
Definition: loaderactioncontroller.h:39
Kasten2::DocumentSyncManager::load
void load(const KUrl &url)
Definition: documentsyncmanager.cpp:90
documentmanager.h
Kasten2::ViewConfigController
Definition: viewconfigcontroller.h:43
Kasten2::DocumentInfoToolView
Definition: documentinfotoolview.h:39
Kasten2::MobileShellWindow::addActionController
void addActionController(AbstractActionController *controller)
Definition: mobileshellwindow.cpp:68
Kasten2::InsertController
Definition: insertcontroller.h:46
Kasten2::ShellWindow::addTool
void addTool(AbstractToolView *toolView)
Definition: shellwindow.cpp:65
Kasten2::PODDecoderTool
Definition: poddecodertool.h:51
Kasten2::CloseController
Definition: documentsystem/close/closecontroller.h:42
Kasten2::FullScreenController
Definition: fullscreencontroller.h:37
Kasten2::StatusBar
Definition: statusbar.h:40
Kasten2::SearchController
Definition: searchcontroller.h:47
Kasten2::QuitController
Definition: quitcontroller.h:40
Kasten2::ReadOnlyBarController
Definition: readonlybarcontroller.h:40
program.h
Kasten2::FileSystemBrowserTool
Definition: filesystembrowsertool.h:41
Kasten2::ZoomController
Definition: zoomcontroller.h:43
Kasten2::ViewStatusController
Definition: viewstatuscontroller.h:50
Kasten2::OktetaProgram::documentManager
DocumentManager * documentManager()
Definition: mobile/program/program.h:72
Kasten2::ZoomBarController
Definition: zoombarcontroller.h:42
Kasten2::OktetaMainWindow::OktetaMainWindow
OktetaMainWindow(OktetaProgram *program)
Definition: mobile/program/mainwindow.cpp:102
Kasten2::DocumentsTool
Definition: documentstool.h:38
Kasten2::VersionViewToolView
Definition: versionviewtoolview.h:39
Kasten2::OktetaMainWindow::readProperties
virtual void readProperties(const KConfigGroup &configGroup)
Definition: mobile/program/mainwindow.cpp:186
Kasten2::ShellWindow::addXmlGuiController
void addXmlGuiController(AbstractXmlGuiController *controller)
Definition: shellwindow.cpp:58
loaderactioncontroller.h
Kasten2::OktetaMainWindow::~OktetaMainWindow
virtual ~OktetaMainWindow()
Definition: mobile/program/mainwindow.cpp:206
Kasten2::TerminalTool
Definition: terminaltool.h:41
Kasten2::GotoOffsetController
Definition: gotooffsetcontroller.h:45
Kasten2::CopyAsController
Definition: copyascontroller.h:46
Kasten2::InfoToolView
Definition: infotoolview.h:39
Kasten2::BookmarksTool
Definition: bookmarkstool.h:47
Kasten2::PODDecoderToolView
Definition: poddecodertoolview.h:39
Kasten2::OktetaMainWindow::mProgram
OktetaProgram * mProgram
Definition: mobile/program/mainwindow.h:52
Kasten2::StringsExtractToolView
Definition: stringsextracttoolview.h:39
Kasten2::ClipboardController
Definition: clipboardcontroller.h:44
Kasten2::SelectController
Definition: selectcontroller.h:43
Kasten2::DocumentCreateManager
Definition: documentcreatemanager.h:41
Kasten2::VersionController
Definition: versioncontroller.h:44
Kasten2::ViewModeController
Definition: viewmodecontroller.h:41
Kasten2::ChecksumTool
Definition: checksumtool.h:51
Kasten2::TerminalToolView
Definition: terminaltoolview.h:39
Kasten2::ViewAreaSplitController
Definition: viewareasplitcontroller.h:46
mainwindow.h
Kasten2::FileSystemBrowserToolView
Definition: filesystembrowsertoolview.h:39
Kasten2::ModifiedBarController
Definition: modifiedbarcontroller.h:43
Kasten2::InfoTool
Definition: infotool.h:48
Kasten2::SynchronizeController
Definition: synchronizecontroller.h:45
Kasten2::BookmarksToolView
Definition: bookmarkstoolview.h:39
Kasten2::OverwriteModeController
Definition: overwritemodecontroller.h:40
Kasten2::SwitchViewController
Definition: switchviewcontroller.h:41
Kasten2::OktetaProgram
Definition: mobile/program/program.h:41
Kasten2::MobileShellWindow
Definition: mobileshellwindow.h:41
Kasten2::LoadedUrlsKey
static const char LoadedUrlsKey[]
Definition: mobile/program/mainwindow.cpp:100
Kasten2::FilterTool
Definition: filtertool.h:47
Kasten2::DocumentInfoTool
Definition: documentinfotool.h:49
Kasten2::OktetaMainWindow::saveProperties
virtual void saveProperties(KConfigGroup &configGroup)
Definition: mobile/program/mainwindow.cpp:178
Kasten2::ReplaceController
Definition: replacecontroller.h:48
Kasten2::ExportController
Definition: exportcontroller.h:46
Kasten2::FilterToolView
Definition: filtertoolview.h:39
Kasten2::PrintController
Definition: printcontroller.h:41
Kasten2::ByteTableToolView
Definition: bytetabletoolview.h:38
Kasten2::DocumentCreateManager::createNew
void createNew()
Definition: documentcreatemanager.cpp:53
Kasten2::OktetaMainWindow::setupControllers
void setupControllers()
Definition: mobile/program/mainwindow.cpp:118
Kasten2::StructToolView
Definition: structtoolview.h:36
Kasten2::ChecksumToolView
Definition: checksumtoolview.h:39
Kasten2::StringsExtractTool
Definition: stringsextracttool.h:51
Kasten2::DocumentManager::syncManager
DocumentSyncManager * syncManager()
Definition: documentmanager.h:108
Kasten2::DocumentManager::createManager
DocumentCreateManager * createManager()
Definition: documentmanager.h:107
Kasten2::DocumentSyncManager
Definition: documentsyncmanager.h:45
Kasten2::ToolListMenuController
Definition: libs/kasten/controllers/shellwindow/toollistmenu/toollistmenucontroller.h:47
Kasten2::MobileShellWindow::mDocumentManager
DocumentManager * mDocumentManager
Definition: mobileshellwindow.h:59
Kasten2::OktetaProgram::viewManager
ViewManager * viewManager()
Definition: program/program.h:71
Kasten2::StructTool
Definition: structtool.h:49
Kasten2::ReadOnlyController
Definition: readonlycontroller.h:41
Kasten2::BookmarksController
Definition: bookmarkscontroller.h:52
Kasten2::SetRemoteController
Definition: setremotecontroller.h:42
Kasten2::DocumentsToolView
Definition: documentstoolview.h:39
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okteta

Skip menu "okteta"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal