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

libkdepim

  • sources
  • kde-4.12
  • kdepim
  • libkdepim
  • widgets
customlogwidget.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2012 Montel Laurent <montel@kde.org>
3 
4  This program is free software; you can redistribute it and/or modify it
5  under the terms of the GNU General Public License, version 2, as
6  published by the Free Software Foundation.
7 
8  This program is distributed in the hope that it will be useful, but
9  WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License along
14  with this program; if not, write to the Free Software Foundation, Inc.,
15  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 #ifndef IMPORTLOGWIDGET_H
19 #define IMPORTLOGWIDGET_H
20 
21 #include "kdepim_export.h"
22 #include <QStyledItemDelegate>
23 #include <QListWidget>
24 
25 class QTextDocument;
26 
27 namespace KPIM {
28 class LogItemDelegate : public QStyledItemDelegate
29 {
30 public:
31  explicit LogItemDelegate( QObject *parent );
32  ~LogItemDelegate();
33 
34  virtual QSize sizeHint ( const QStyleOptionViewItem &option, const QModelIndex &index ) const;
35  virtual void paint ( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const;
36  virtual QWidget *createEditor ( QWidget *, const QStyleOptionViewItem &, const QModelIndex & ) const;
37 
38 
39 private:
40  QTextDocument* document ( const QStyleOptionViewItem &option, const QModelIndex &index ) const;
41 };
42 
43 class KDEPIM_EXPORT CustomLogWidget : public QListWidget
44 {
45 public:
46  explicit CustomLogWidget( QWidget * parent = 0 );
47  ~CustomLogWidget();
48 
49  void addInfoLogEntry( const QString &log );
50  void addErrorLogEntry( const QString &log );
51  void addTitleLogEntry( const QString &log );
52  void addEndLineLogEntry();
53 
54  QString toHtml() const;
55  QString toPlainText() const;
56  bool isEmpty() const;
57 
58 private:
59  enum ItemType {
60  ItemLogType = Qt::UserRole + 1
61  };
62 
63  enum LogType {
64  Title=0,
65  Error,
66  Info,
67  EndLine
68  };
69 };
70 }
71 
72 #endif /* IMPORTLOGWIDGET_H */
73 
kdepim_export.h
KPIM::LogItemDelegate::LogItemDelegate
LogItemDelegate(QObject *parent)
Definition: customlogwidget.cpp:27
QWidget
QListWidget
QObject
QStyledItemDelegate
KPIM::LogItemDelegate::sizeHint
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: customlogwidget.cpp:85
KPIM::LogItemDelegate::paint
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: customlogwidget.cpp:59
KPIM::LogItemDelegate::createEditor
virtual QWidget * createEditor(QWidget *, const QStyleOptionViewItem &, const QModelIndex &) const
Definition: customlogwidget.cpp:100
KPIM::LogItemDelegate
Definition: customlogwidget.h:28
KPIM::CustomLogWidget
Definition: customlogwidget.h:43
KPIM::LogItemDelegate::~LogItemDelegate
~LogItemDelegate()
Definition: customlogwidget.cpp:32
KDEPIM_EXPORT
#define KDEPIM_EXPORT
Definition: kdepim_export.h:35
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkdepim

Skip menu "libkdepim"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

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