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

messageviewer

  • sources
  • kde-4.14
  • kdepim
  • messageviewer
  • viewer
editorwatcher.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2007 Volker Krause <vkrause@kde.org>
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18 
19 #ifndef MESSAGEVIEWER_EDITORWATCHER_H
20 #define MESSAGEVIEWER_EDITORWATCHER_H
21 
22 #include "messageviewer_export.h"
23 #include <kurl.h>
24 
25 #include <qobject.h>
26 #include <qtimer.h>
27 #include <QTime>
28 class KProcess;
29 
30 namespace MessageViewer {
31 
32 
39 class MESSAGEVIEWER_EXPORT EditorWatcher : public QObject
40 {
41  Q_OBJECT
42 public:
43  enum OpenWithOption {
44  OpenWithDialog,
45  NoOpenWithDialog
46  };
47  enum ErrorEditorWatcher {
48  Unknown = 0,
49  Canceled,
50  NoServiceFound,
51  CannotStart,
52  NoError
53  };
54 
62  EditorWatcher( const KUrl &url, const QString &mimeType, OpenWithOption option,
63  QObject *parent, QWidget *parentWidget );
64  ~EditorWatcher();
65  ErrorEditorWatcher start();
66  bool fileChanged() const;
67  KUrl url() const;
68 signals:
69  void editDone( MessageViewer::EditorWatcher* watcher );
70 
71 private slots:
72  void editorExited();
73  void inotifyEvent();
74  void checkEditDone();
75 
76 private:
77  KUrl mUrl;
78  QString mMimeType;
79  QTimer mTimer;
80  QTime mEditTime;
81 
82  KProcess *mEditor;
83  QWidget *mParentWidget;
84 
85  int mInotifyFd;
86  int mInotifyWatch;
87  OpenWithOption mOpenWithOption;
88  bool mHaveInotify;
89  bool mFileOpen;
90  bool mEditorRunning;
91  bool mFileModified;
92  bool mDone;
93 };
94 
95 }
96 
97 #endif
QWidget
MessageViewer::EditorWatcher
Starts an editor for the given URL and emits an signal when editing has been finished.
Definition: editorwatcher.h:39
QTime
MessageViewer::EditorWatcher::NoServiceFound
Definition: editorwatcher.h:50
QTimer
MessageViewer::EditorWatcher::OpenWithDialog
Definition: editorwatcher.h:44
QObject
MessageViewer::EditorWatcher::OpenWithOption
OpenWithOption
Definition: editorwatcher.h:43
QString
MESSAGEVIEWER_EXPORT
#define MESSAGEVIEWER_EXPORT
Definition: messageviewer_export.h:37
MessageViewer::EditorWatcher::Canceled
Definition: editorwatcher.h:49
MessageViewer::EditorWatcher::ErrorEditorWatcher
ErrorEditorWatcher
Definition: editorwatcher.h:47
MessageViewer::EditorWatcher::CannotStart
Definition: editorwatcher.h:51
messageviewer_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:45 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

messageviewer

Skip menu "messageviewer"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

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
  • pimprint

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