KDevelop API Documentation

parts/fullscreen/fullscreen_part.cpp

Go to the documentation of this file.
00001 /*************************************************************************** 00002 * Copyright (C) 2003 by Roberto Raggi * 00003 * roberto@kdevelop.org * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 ***************************************************************************/ 00011 00012 #include <kiconloader.h> 00013 #include <klocale.h> 00014 #include <kdevgenericfactory.h> 00015 #include <kaction.h> 00016 #include <kmainwindow.h> 00017 #include <kmenubar.h> 00018 00019 #include <kdevcore.h> 00020 #include <kdevmainwindow.h> 00021 00022 #include "fullscreen_part.h" 00023 00024 static const KAboutData data("kdevfullscreen", I18N_NOOP("Full-screen mode"), "1.0"); 00025 00026 typedef KDevGenericFactory<FullScreenPart> FullScreenFactory; 00027 K_EXPORT_COMPONENT_FACTORY( libkdevfullscreen, FullScreenFactory( &data ) ) 00028 00029 FullScreenPart::FullScreenPart(QObject *parent, const char *name, const QStringList& ) 00030 : KDevPlugin("KDevPart", "kdevpart", parent, name ? name : "FullScreenPart" ) 00031 { 00032 setInstance(FullScreenFactory::instance()); 00033 setXMLFile("kdevpart_fullscreen.rc"); 00034 00035 m_bFullScreen = false; 00036 00037 m_pFullScreen = new KAction( i18n( "&Full-Screen Mode" ), "window_fullscreen", CTRL+SHIFT+Key_F, this, 00038 SLOT( slotToggleFullScreen() ), actionCollection(), "fullscreen" ); 00039 m_pFullScreen->setToolTip(i18n("Full-screen mode")); 00040 m_pFullScreen->setWhatsThis(i18n("<b>Full-screen mode</b><p>Enters or exits full screen mode (also hides menubar when switching into full screen mode).")); 00041 } 00042 00043 FullScreenPart::~FullScreenPart() 00044 { 00045 } 00046 00047 void FullScreenPart::slotToggleFullScreen( ) 00048 { 00049 KMainWindow* mw = mainWindow()->main(); 00050 m_bFullScreen = !m_bFullScreen; 00051 if( m_bFullScreen ){ 00052 mw->menuBar()->hide(); 00053 mw->showFullScreen(); 00054 00055 m_pFullScreen->setText( i18n( "Exit Full-Screen Mode" ) ); 00056 m_pFullScreen->setToolTip( i18n( "Exit full-screen mode" ) ); 00057 m_pFullScreen->setIcon( "window_nofullscreen" ); 00058 } else { 00059 mw->menuBar()->show(); 00060 00061 mw->showNormal(); 00062 00063 m_pFullScreen->setText( i18n( "&Full-Screen Mode" ) ); 00064 m_pFullScreen->setToolTip(i18n("Full-screen mode")); 00065 m_pFullScreen->setIcon( "window_fullscreen" ); 00066 } 00067 } 00068 00069 00070 #include "fullscreen_part.moc"
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Oct 6 17:39:12 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003