Blokkal
an Extendable KDE Blogging Client
SourceForge.net Logo

editentrywidget.h

00001 /***************************************************************************
00002  *   Copyright (C) 2006 - 2008 by Martin Mueller                           *
00003  *   orvio@orvio.de                                                        *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 #ifndef BLOKKALUIEDITENTRYWIDGET_H
00021 #define BLOKKALUIEDITENTRYWIDGET_H
00022 
00023 #include <QtGui/QWidget>
00024 
00025 #include "entryextensionwidget.h"
00026 #include "../blokkal_export.h"
00027 
00028 class KAction;
00029 class KActionCollection;
00030 
00031 namespace Blokkal {
00032 class Blog;
00033 class Entry;
00034 namespace Ui {
00035 class HtmlEntryTextEdit;
00036 class FormattingBackend;
00057 class BLOKKAL_EXPORT EditEntryWidget : public QWidget
00058 {
00059 Q_OBJECT
00060 public:
00068         EditEntryWidget( Blokkal::Entry * entry, QWidget * parentWidget = 0 );
00069         
00073         ~EditEntryWidget( void );
00074 
00079         Blokkal::Entry * apply( void );
00080 
00086         Blokkal::Entry * entry( void ) const;
00087 
00093         Blokkal::Ui::EntryExtensionWidget * extensionWidget( EntryExtensionWidget::ExtensionWidget extension ) const;
00094 
00100         bool isContentLegal( void );
00101 
00105         Blokkal::Ui::FormattingBackend * formattingBackend( void ) const;
00106 
00113         void hideFeature( unsigned int features );
00114         
00115         QString caption( void ) const;
00116         void setCaption( const QString & caption );     
00117 
00118 public Q_SLOTS:
00124         void rollBack( void );
00125         
00126 Q_SIGNALS:
00132         void contentsChanged( void );
00133 
00138         void captionChanged( const QString & newCaption );
00139 
00148         void newCategory( const QString & newCategoryString );
00149 
00158         void destroyCategory( const QString & removeCategoryId );
00159 
00160 protected:
00164         Blokkal::Ui::HtmlEntryTextEdit * entryTextEdit( void ) const;
00165 
00166 private Q_SLOTS:
00167         void updateEntryDateTime( void );
00168         void emitContentsChanged( void );
00169         void slotDateChanged( void );
00170         void emitNewCategory( void );
00171         void emitCategoryRemoved( const QString & categoryId );
00172 
00173         void updateSplitterVisibility( void );
00174 
00175 private:
00176         friend class View;
00177         class Private;
00178         Private * const d;
00179 };
00180 
00181 }
00182 }
00183 
00184 #endif