Warning, /kdevelop/kdevelop/app/shell.dox is written in an unsupported language. File is not indexed.

0001 /**
0002 @page The KDevelop Generic Shell
0003 
0004 This library contains the Shell - a profile-based implementation of KDevelop plugin architecture.
0005 
0006 <b>Link with</b>: -lkdevshell
0007 
0008 <b>Include path</b>: -I\$(kde_includes)/kdevelop/shell
0009 
0010 \section creatingapp Creating an application using generic shell
0011 KDevelop platform applications can use generic shell as a ready to use implementation
0012 of KDevelop plugin architecture.
0013 
0014 This is done by creating application %main.cpp file and @ref ShellExtension subclass.
0015 Example:
0016 - %main.cpp for "myapp" application:
0017     @code
0018     #include <config.h>
0019     
0020     #include <kaboutdata.h>
0021     #include <kapplication.h>
0022     #include <kcmdlineargs.h>
0023     #include <klocale.h>
0024     #include <dcopclient.h>
0025     
0026     #include <splashscreen.h>
0027     #include <toplevel.h>
0028     #include <plugincontroller.h>
0029     #include <partcontroller.h>
0030     #include <core.h>
0031     #include <projectmanager.h>
0032     #include <newmainwindow.h>
0033     
0034     #include "myappextension.h"
0035     
0036     static KCmdLineOptions options[] =
0037     {
0038         { "profile <profile>",  I18N_NOOP("Profile to load"), 0 },
0039         { 0,0,0 }
0040     };
0041     
0042     int main(int argc, char *argv[])
0043     {
0044         static const char description[] = I18N_NOOP("My Application");
0045         KAboutData aboutData("myapp", I18N_NOOP("My Application"),
0046                         VERSION, description, KAboutData::License_GPL,
0047                         I18N_NOOP("(c) 1999-2004, MyApp developers"),
0048                         "", "http://www.myapp.org");
0049         aboutData.addAuthor("Me", I18N_NOOP("Creator"), "me@myapp.org");
0050     
0051         KCmdLineArgs::init(argc, argv, &aboutData);
0052         KCmdLineArgs::addCmdLineOptions( options );
0053     
0054         KApplication app;
0055 
0056         MyAppExtension::init();
0057     
0058         QPixmap pm;
0059         pm.load(locate("data", "myapp/pics/myapp-splash.png"));
0060         SplashScreen * splash = new SplashScreen( pm );
0061         splash->show();
0062     
0063         app.processEvents();
0064     
0065         QObject::connect(PluginController::getInstance(), SIGNAL(loadingPlugin(const QString &)),
0066             splash, SLOT(showMessage(const QString &)));
0067     
0068         splash->message( i18n( "Loading Settings" ) );
0069         TopLevel::getInstance()->loadSettings();
0070     
0071         PluginController::getInstance()->loadInitialPlugins();
0072     
0073         splash->message( i18n( "Starting GUI" ) );
0074         NewMainWindow *mw = dynamic_cast<NewMainWindow*>(TopLevel::getInstance()->main());
0075         if (mw)
0076             mw->enableShow();
0077         TopLevel::getInstance()->main()->show();
0078     
0079         Core::getInstance()->doEmitCoreInitialized();
0080     
0081         delete splash;
0082     
0083         kapp->dcopClient()->registerAs("myapp");
0084     
0085         return app.exec();
0086     }
0087     @endcode
0088     
0089 - Shell extension for "myapp" application:
0090     @code
0091     class MyAppExtension: public ShellExtension {
0092     public:
0093         static void init()
0094         {
0095             s_instance = new MyAppExtension();
0096         }
0097 
0098         virtual void createGlobalSettingsPage(KDialogBase *dlg) {};
0099         virtual void acceptGlobalSettingsPage(KDialogBase *dlg) {};
0100     
0101         virtual QString xmlFile()
0102         {
0103             return "myappui.rc";
0104         }
0105         
0106         virtual QString defaultProfile()
0107         {
0108             return "MyApp";
0109         }
0110             
0111     protected:
0112         KDevAssistantExtension();
0113     
0114     };
0115     @endcode
0116 
0117 */
0118