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

knode

  • sources
  • kde-4.12
  • kdepim
  • knode
  • composer
attachment_view.h
Go to the documentation of this file.
1 /*
2  Copyright 2010 Olivier Trichet <nive@nivalis.org>
3 
4  Permission to use, copy, modify, and distribute this software
5  and its documentation for any purpose and without fee is hereby
6  granted, provided that the above copyright notice appear in all
7  copies and that both that the copyright notice and this
8  permission notice and warranty disclaimer appear in supporting
9  documentation, and that the name of the author not be used in
10  advertising or publicity pertaining to distribution of the
11  software without specific, written prior permission.
12 
13  The author disclaim all warranties with regard to this
14  software, including all implied warranties of merchantability
15  and fitness. In no event shall the author be liable for any
16  special, indirect or consequential damages or any damages
17  whatsoever resulting from loss of use, data or profits, whether
18  in an action of contract, negligence or other tortious action,
19  arising out of or in connection with the use or performance of
20  this software.
21 */
22 
23 #ifndef KNODE_COMPOSER_ATTACHMENT_VIEW_H
24 #define KNODE_COMPOSER_ATTACHMENT_VIEW_H
25 
26 #include "knarticle.h"
27 
28 #include <QTreeWidget>
29 
30 
31 namespace KNode {
32 namespace Composer {
33 
37 class AttachmentView : public QTreeWidget
38 {
39  Q_OBJECT
40 
41  public:
45  enum Column {
46  File = 0,
47  Type = 1,
48  Size = 2,
49  Description = 3,
50  Encoding = 4
51  };
52 
53 
58  explicit AttachmentView( QWidget *parent = 0 );
62  virtual ~AttachmentView();
63 
64 
68  const QList<KNAttachment::Ptr> attachments();
69 
70 
71  public slots:
75  void removeCurrentAttachment();
79  void editCurrentAttachment();
80 
81 
82  signals:
88  void attachmentRemoved( KNAttachment::Ptr attachment, bool last );
89 
93  void deletePressed();
97  void returnPressed();
98 
103  void contextMenuRequested( const QPoint &point );
104 
105  protected:
109  virtual void keyPressEvent( QKeyEvent *event );
113  virtual void contextMenuEvent( QContextMenuEvent *event );
114 };
115 
116 
120 class AttachmentViewItem : public QTreeWidgetItem
121 {
122  friend class AttachmentView;
123 
124  public:
128  AttachmentViewItem( AttachmentView *parent, KNAttachment::Ptr attachment );
132  virtual ~AttachmentViewItem();
133 
137  QVariant data( int column, int role ) const;
138 
139  private:
140  KNAttachment::Ptr mAttachment;
141 };
142 
143 
144 } // namespace Composer
145 } // namespace KNode
146 
147 
148 #endif // KNODE_COMPOSER_ATTACHMENT_VIEW_H
KNode::Composer::AttachmentView::removeCurrentAttachment
void removeCurrentAttachment()
Remove the currently selected attachment if there is a selection.
Definition: attachment_view.cpp:51
KNode::Composer::AttachmentView::File
file name.
Definition: attachment_view.h:46
KNode::Composer::AttachmentViewItem::data
QVariant data(int column, int role) const
Reimplemented to return data from the underlying KNAttachment.
Definition: attachment_view.cpp:144
KNode::Composer::AttachmentViewItem
Item of the AttachmentView.
Definition: attachment_view.h:120
KNode::Composer::AttachmentView::AttachmentView
AttachmentView(QWidget *parent=0)
Constructor for the selection widget of identity.
Definition: attachment_view.cpp:36
QTreeWidget
KNode::Composer::AttachmentView
Attachment view in the composer.
Definition: attachment_view.h:37
KNode::Composer::AttachmentView::returnPressed
void returnPressed()
This signal is emitted when the Return or Enter key is pressed on this widget.
KNode::Composer::AttachmentViewItem::~AttachmentViewItem
virtual ~AttachmentViewItem()
Destructor.
Definition: attachment_view.cpp:140
QWidget
KNode::Composer::AttachmentView::editCurrentAttachment
void editCurrentAttachment()
Edit the currently selected attachment.
Definition: attachment_view.cpp:64
KNode::Composer::AttachmentView::Column
Column
List of column.
Definition: attachment_view.h:45
KNode::Composer::AttachmentViewItem::AttachmentViewItem
AttachmentViewItem(AttachmentView *parent, KNAttachment::Ptr attachment)
Constructor.
Definition: attachment_view.cpp:133
KNode::Composer::AttachmentView::Description
description of the attachment.
Definition: attachment_view.h:49
KNode::Composer::AttachmentView::attachments
const QList< KNAttachment::Ptr > attachments()
Returns the list of attachments contained by this view .
Definition: attachment_view.cpp:85
KNode::Composer::AttachmentView::Size
size.
Definition: attachment_view.h:48
KNode::Composer::AttachmentView::deletePressed
void deletePressed()
This signal is emitted when the Delete key is pressed on this widget.
KNode::Composer::AttachmentView::~AttachmentView
virtual ~AttachmentView()
Destructor.
Definition: attachment_view.cpp:45
KNode::Composer::AttachmentView::contextMenuEvent
virtual void contextMenuEvent(QContextMenuEvent *event)
Reimplemented to emit the contextMenuRequested() signal.
Definition: attachment_view.cpp:117
QTreeWidgetItem
KNode::Composer::AttachmentView::keyPressEvent
virtual void keyPressEvent(QKeyEvent *event)
Reimplemented to emit the deletePressed() and returnPressed() signals.
Definition: attachment_view.cpp:100
KNode::Composer::AttachmentView::contextMenuRequested
void contextMenuRequested(const QPoint &point)
Request a context menu on an attachment item at point.
knarticle.h
KNode::Composer::AttachmentView::Type
mime-type.
Definition: attachment_view.h:47
KNode::Composer::AttachmentView::Encoding
MIME encoding (7bit, base64, etc.).
Definition: attachment_view.h:50
KNode::Composer::AttachmentView::attachmentRemoved
void attachmentRemoved(KNAttachment::Ptr attachment, bool last)
This signal is emitted when an attachment was actually removed.
KNAttachment::Ptr
boost::shared_ptr< KNAttachment > Ptr
Shared pointer to a KNAttachment.
Definition: knarticle.h:281
QList< KNAttachment::Ptr >
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:36 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

knode

Skip menu "knode"
  • Main Page
  • Namespace List
  • 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

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