📄 krviewer.h
字号:
/*************************************************************************** krviewer.h - description ------------------- begin : Thu Apr 18 2002 copyright : (C) 2002 by Shie Erlich & Rafi Yanai email : ***************************************************************************//*************************************************************************** * * * 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 KRVIEWER_H#define KRVIEWER_H#include <qwidget.h>#include <qptrlist.h>#include <kparts/mainwindow.h>#include <ktempfile.h>#include <kparts/partmanager.h>#include <kparts/browserextension.h>#include <qguardedptr.h>#include <ktabwidget.h>#include "../krusader.h"/** *@author Shie Erlich & Rafi Yanai */class QPopupMenu;class PanelViewerBase;class KrViewer : public KParts::MainWindow { Q_OBJECTpublic: virtual ~KrViewer(); enum Mode{Generic,Text,Hex}; static void view( KURL url, QWidget * parent = krApp ); static void view( KURL url, Mode mode, bool new_window, QWidget * parent = krApp ); static void edit( KURL url, QWidget * parent ); static void edit( KURL url, Mode mode=Text, int new_window=-1, QWidget * parent = krApp ); virtual bool eventFilter ( QObject * watched, QEvent * e );public slots: void keyPressEvent( QKeyEvent *e ); void createGUI( KParts::Part* ); void viewGeneric(); void viewText(); void viewHex(); void editText(); void print(); void copy(); void tabChanged(QWidget* w); void tabURLChanged( PanelViewerBase * pvb, const KURL &url ); void tabCloseRequest(QWidget *w); void tabCloseRequest(); void nextTab(); void prevTab(); void detachTab(); void checkModified();protected: virtual bool queryClose(); virtual bool queryExit(); virtual void windowActivationChange ( bool oldActive ); virtual void focusInEvent( QFocusEvent * ){ if( viewers.remove( this ) ) viewers.prepend( this ); } // move to firstprivate: KrViewer( QWidget *parent = 0, const char *name = 0 ); void addTab(PanelViewerBase* pvb, QString msg,QString iconName, KParts::Part* part); PanelViewerBase * getPanelViewerBase( KParts::Part* part); void updateActions( PanelViewerBase * base ); static KrViewer* getViewer(bool new_window); KParts::PartManager manager; QPopupMenu* viewerMenu; KTempFile tmpFile; KTabWidget tabBar; QGuardedPtr<QWidget> returnFocusTo; PanelViewerBase * returnFocusTab; int detachActionIndex; KAction *printAction; KAction *copyAction; int tabCloseID; int closeID; static QPtrList<KrViewer> viewers; // the first viewer is the active one QValueList<int> reservedKeys; // the reserved key sequences QValueList<int> reservedKeyIDs; // the IDs of the reserved keys};class Invoker : public QObject { Q_OBJECT public: Invoker( QObject *recv, const char * slot ) { connect( this, SIGNAL( invokeSignal() ), recv, slot ); } void invoke() { emit invokeSignal(); } signals: void invokeSignal();};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -