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

kate/interfaces/kate

Kate::MainWindow

Kate::MainWindow Class Reference

Interface to a mainwindow. More...

#include <mainwindow.h>

Inheritance diagram for Kate::MainWindow:
Inheritance graph
[legend]

List of all members.

Public Types

enum  Position { Left = 0, Right = 1, Top = 2, Bottom = 3 }

Signals

void viewChanged ()
void viewCreated (KTextEditor::View *view)

Public Member Functions

 MainWindow (void *mainWindow)
virtual ~MainWindow ()
KTextEditor::View * activateView (KTextEditor::Document *document)
KTextEditor::View * activeView ()
class QWidget * centralWidget () const
QWidget * createToolView (const QString &identifier, MainWindow::Position pos, const QPixmap &icon, const QString &text)
KXMLGUIFactory * guiFactory () const
bool hideToolView (QWidget *widget)
bool moveToolView (QWidget *widget, MainWindow::Position pos)
KTextEditor::View * openUrl (const KUrl &url, const QString &encoding=QString())
bool showToolView (QWidget *widget)
class QWidget * window () const

Detailed Description

Interface to a mainwindow.

Introduction

The class MainWindow represents a toplevel window, with menu bar, statusbar etc, get it with window(). A mainwindow usually has an active View, access it with activeView(). To set another active view use activateView().

Toolviews

It is possible to embedd new toolviews into a mainwindow. To create a toolview use createToolView(), then you can move, hide or show the toolview by using moveToolView(), hideToolView() or showToolView().

With guiFactory() you can access the KXMLGUIFactory framework and add gui clients.

To access a mainwindow use the Application object. You should never have to create an instance of this class yourself.

Author:
Christoph Cullmann <cullmann@kde.org>
See also:
KXMLGUIFactory

Definition at line 65 of file mainwindow.h.


Member Enumeration Documentation

enum Kate::MainWindow::Position

Toolview position.

A toolview can only be at one side at a time.

Enumerator:
Left 

Left side.

Right 

Right side.

Top 

Top side.

Bottom 

Bottom side.

Definition at line 173 of file mainwindow.h.


Constructor & Destructor Documentation

Kate::MainWindow::MainWindow ( void *  mainWindow  ) 

Constructor.

Create a new mainwindow. You as a plugin developer should never have to create a new mainwindow yourself. Access the mainwindows via the global Application.

Parameters:
mainWindow internal usage

For internal use only.

Definition at line 45 of file mainwindow.cpp.

Kate::MainWindow::~MainWindow (  )  [virtual]

Virtual destructor.

Definition at line 51 of file mainwindow.cpp.


Member Function Documentation

KTextEditor::View * Kate::MainWindow::activateView ( KTextEditor::Document *  document  ) 

Activate the view with the corresponding document.

If none exist for this document, create one

Parameters:
document the document
Returns:
activated view of this document

Definition at line 76 of file mainwindow.cpp.

KTextEditor::View * Kate::MainWindow::activeView (  ) 

Access the active view.

Returns:
active view

Definition at line 71 of file mainwindow.cpp.

QWidget * Kate::MainWindow::centralWidget (  )  const

Access the widget (in the middle of the four sidebars) in which the editor component and the KateTabBar are embedded.

This widget is a KVBox, so other child widgets can be embedded themselves under the editor widget.

Returns:
the central widget

Definition at line 66 of file mainwindow.cpp.

QWidget * Kate::MainWindow::createToolView ( const QString &  identifier,
MainWindow::Position  pos,
const QPixmap &  icon,
const QString &  text 
)

Create a new toolview with unique identifier at side pos with icon and caption text.

Use the returned widget to embedd your widgets.

Parameters:
identifier unique identifier for this toolview
pos position for the toolview, if we are in session restore, this is only a preference
icon icon to use in the sidebar for the toolview
text translated text (i18n()) to use in addition to icon
Returns:
created toolview on success, otherwise NULL

Definition at line 86 of file mainwindow.cpp.

KXMLGUIFactory * Kate::MainWindow::guiFactory (  )  const

Accesstor to the XMLGUIFactory.

Returns:
the mainwindow's KXMLGUIFactory.

Definition at line 56 of file mainwindow.cpp.

bool Kate::MainWindow::hideToolView ( QWidget *  widget  ) 

Hide the toolview widget.

Parameters:
widget the toolview to hide, where the widget was constructed by createToolView().
Returns:
true on success, otherwise false

Definition at line 107 of file mainwindow.cpp.

bool Kate::MainWindow::moveToolView ( QWidget *  widget,
MainWindow::Position  pos 
)

Move the toolview widget to position pos.

Parameters:
widget the toolview to move, where the widget was constructed by createToolView().
pos new position to move widget to
Returns:
true on success, otherwise false

Definition at line 91 of file mainwindow.cpp.

KTextEditor::View * Kate::MainWindow::openUrl ( const KUrl &  url,
const QString &  encoding = QString() 
)

Open the document url with the given encoding.

Parameters:
url the document's url
encoding the preferred encoding. If encoding is QString() the encoding will be guessed or the default encoding will be used.
Returns:
a pointer to the created view for the new document, if a document with this url is already existing, it's view will be activated

Definition at line 81 of file mainwindow.cpp.

bool Kate::MainWindow::showToolView ( QWidget *  widget  ) 

Show the toolview widget.

Parameters:
widget the toolview to show, where the widget was constructed by createToolView().
Returns:
true on success, otherwise false
Todo:
add focus parameter: bool showToolView (QWidget *widget, bool giveFocus );

Definition at line 99 of file mainwindow.cpp.

void Kate::MainWindow::viewChanged (  )  [signal]

This signal is emitted whenever the active view changes.

void Kate::MainWindow::viewCreated ( KTextEditor::View *  view  )  [signal]

This signal is emitted whenever a new view is created.

Since:
4.2
QWidget * Kate::MainWindow::window (  )  const

Get the toplevel widget.

Returns:
the kate main window.

Definition at line 61 of file mainwindow.cpp.


The documentation for this class was generated from the following files:
  • mainwindow.h
  • mainwindow.cpp

kate/interfaces/kate

Skip menu "kate/interfaces/kate"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdesdk

Skip menu "kdesdk"
  • kapptemplate
  • kate
  •     kate
  • kbugbuster
  • kcachegrind
  • kompare
  • lokalize
  • umbrello
  •   umbrello
Generated for kdesdk by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal