diff --git a/src/workpackage/debugarea.h b/src/workpackage/debugarea.h index d54d990c..e173138b 100644 --- a/src/workpackage/debugarea.h +++ b/src/workpackage/debugarea.h @@ -1,34 +1,34 @@ /* This file is part of the KDE project Copyright (C) 2012 Dag Andersen This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef PLANWORK_DEBUGAREA #define PLANWORK_DEBUGAREA -#include "kplatowork_export.h" +#include "planwork_export.h" #include #include -extern const KPLATOWORK_EXPORT QLoggingCategory &PLANWORK_LOG(); +extern const PLANWORK_EXPORT QLoggingCategory &PLANWORK_LOG(); #define debugPlanWork qCDebug(PLANWORK_LOG)< Copyright (C) 2009 Dag Andersen This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KPLATOWORK_FACTORY_H #define KPLATOWORK_FACTORY_H -#include "kplatowork_export.h" +#include "planwork_export.h" #include class KAboutData; class KoComponentData; namespace KPlatoWork { -class KPLATOWORK_EXPORT Factory : public KPluginFactory +class PLANWORK_EXPORT Factory : public KPluginFactory { Q_OBJECT public: explicit Factory(); ~Factory(); virtual QObject* create(const char* iface, QWidget* parentWidget, QObject *parent, const QVariantList& args, const QString& keyword); static const KoComponentData &global(); static KAboutData* aboutData(); private: static KoComponentData* s_global; static KAboutData* s_aboutData; }; } // KPlatoWork namespace #endif diff --git a/src/workpackage/mainwindow.h b/src/workpackage/mainwindow.h index 334732d5..900cdce0 100644 --- a/src/workpackage/mainwindow.h +++ b/src/workpackage/mainwindow.h @@ -1,91 +1,91 @@ /* This file is part of the KDE project Copyright (C) 1998, 1999 Torben Weis Copyright (C) 1999 Simon Hausmann Copyright (C) 2000-2005 David Faure Copyright (C) 2005 Sven L�ppken Copyright (C) 2008 - 2009 Dag Andersen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KPLATOWORK_MAINWINDOW_H #define KPLATOWORK_MAINWINDOW_H -#include "kplatowork_export.h" +#include "planwork_export.h" #include #include #include #include namespace KParts { } namespace KPlatoWork { class Part; } namespace KPlato { class Document; } /////// class KPlatoWork_MainWindow //////// -class KPLATOWORK_EXPORT KPlatoWork_MainWindow : public KParts::MainWindow +class PLANWORK_EXPORT KPlatoWork_MainWindow : public KParts::MainWindow { Q_OBJECT public: explicit KPlatoWork_MainWindow(); virtual ~KPlatoWork_MainWindow(); KPlatoWork::Part *rootDocument() const { return m_part; } bool openDocument(const QUrl & url); virtual QString configFile() const; void editDocument( KPlatoWork::Part *part, const KPlato::Document *doc ); // bool isEditing() const { return m_editing; } // bool isModified() const; Q_SIGNALS: void undo(); void redo(); public Q_SLOTS: virtual void slotFileClose(); virtual void setCaption( const QString &text ); virtual void setCaption( const QString &text, bool modified ); protected Q_SLOTS: virtual bool queryClose(); virtual void slotFileOpen(); /** * Saves all workpackages */ virtual void slotFileSave(); protected: virtual bool saveDocument( bool saveas = false, bool silent = false ); private: KPlatoWork::Part *m_part; }; #endif // KPLATOWORK_MAINWINDOW_H diff --git a/src/workpackage/packagesettings.h b/src/workpackage/packagesettings.h index 047c2e00..9e5828c4 100644 --- a/src/workpackage/packagesettings.h +++ b/src/workpackage/packagesettings.h @@ -1,72 +1,72 @@ /* This file is part of the KDE project Copyright (C) 2009 Dag Andersen This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KPLATOWORK_PACKAGESETTINGS_H #define KPLATOWORK_PACKAGESETTINGS_H -#include "kplatowork_export.h" +#include "planwork_export.h" #include "ui_packagesettings.h" #include "workpackage.h" #include class KUndo2Command; namespace KPlatoWork { class PackageSettingsPanel; -class KPLATOWORK_EXPORT PackageSettingsDialog : public KoDialog +class PLANWORK_EXPORT PackageSettingsDialog : public KoDialog { Q_OBJECT public: explicit PackageSettingsDialog( WorkPackage &p, QWidget *parent=0 ); KUndo2Command *buildCommand(); private: PackageSettingsPanel *dia; }; class PackageSettingsPanel : public QWidget, public Ui_PackageSettings { Q_OBJECT public: explicit PackageSettingsPanel( WorkPackage &p, QWidget *parent=0 ); KUndo2Command *buildCommand(); WorkPackageSettings settings() const; void setSettings( const WorkPackageSettings &settings ); Q_SIGNALS: void changed( bool ); public Q_SLOTS: void slotChanged(); protected: WorkPackage &m_package; }; } //KPlatoWork namespace #endif diff --git a/src/workpackage/part.h b/src/workpackage/part.h index 76f7a684..3b7e51a7 100644 --- a/src/workpackage/part.h +++ b/src/workpackage/part.h @@ -1,262 +1,262 @@ /* This file is part of the KDE project Copyright (C) 1998, 1999, 2000 Torben Weis Copyright (C) 2004 - 2009 Dag Andersen Copyright (C) 2006 Raphael Langerhorst Copyright (C) 2007 Thorsten Zachmann Copyright (C) 2007 - 2009 Dag Andersen This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KPLATOWORK_PART_H #define KPLATOWORK_PART_H -#include "kplatowork_export.h" +#include "planwork_export.h" #include "kptxmlloaderobject.h" #include #include #include #include #include class KUndo2QStack; class KoStore; class KProcess; class QFileSystemWatcher; namespace KPlato { class Project; class Document; class MacroCommand; } using namespace KPlato; /// The main namespace for KPlato WorkPackage Handler namespace KPlatoWork { class Part; class WorkPackage; /** * DocumentChild stores info about documents opened for editing. * Editors can be KParts, Calligra or Other. */ class DocumentChild : public QObject { Q_OBJECT public: // The type of document this child handles enum DocType { Type_Unknown = 0, Type_Calligra, Type_KParts, Type_Other }; explicit DocumentChild( WorkPackage *parent ); // DocumentChild( KParts::ReadWritePart *editor, const QUrl &url, const Document *doc, Part *parent); ~DocumentChild(); WorkPackage *parentPackage() const; const Document *doc() const { return m_doc; } /// Set document, return true if ok, false if failure bool setDoc( const Document *doc ); /// Open @p doc from @p store bool openDoc( const Document *doc, KoStore *store ); /// Open document for editing, return true if ok, false if failure bool editDoc(); bool isOpen() const { return m_process != 0; } bool isModified() const; bool isFileModified() const; QString fileName() const { return m_fileinfo.fileName(); } QString filePath() const { return m_fileinfo.canonicalFilePath(); } void setFileInfo( const QUrl &url ); const QFileInfo &fileInfo() const { return m_fileinfo; } QUrl url() const { return QUrl::fromLocalFile( filePath() ); } KParts::ReadWritePart *editor() const { return m_editor; } bool startProcess( KService::Ptr service, const QUrl &url = QUrl() ); int type() const { return m_type; } void setType( int type ) { m_type = type; } bool saveToStore( KoStore *store ); Q_SIGNALS: void modified( bool ); void fileModified( bool ); public Q_SLOTS: void setModified( bool mod ); protected Q_SLOTS: void slotEditFinished( int, QProcess::ExitStatus ); void slotEditError( QProcess::ProcessError status ); void slotDirty( const QString &file ); void slotUpdateModified(); protected: const Document *m_doc; int m_type; bool m_copy; KProcess *m_process; // Used if m_type == Type_Other; KParts::ReadWritePart *m_editor; // 0 if m_type == Type_Other QFileInfo m_fileinfo; bool m_editormodified; bool m_filemodified; QFileSystemWatcher *m_fileSystemWatcher; }; /** This part handles work packages. A work package file consists of a Project node and one Task node along with scheduling information and assigned resources. */ -class KPLATOWORK_EXPORT Part : public KParts::ReadWritePart +class PLANWORK_EXPORT Part : public KParts::ReadWritePart { Q_OBJECT public: explicit Part( QWidget *parentWidget, QObject *parent, const QVariantList & /*args*/ = QVariantList() ); ~Part(); int docType( const Document *doc ) const; bool loadWorkPackages(); virtual bool loadXML( const KoXmlDocument &document, KoStore *store ); virtual QDomDocument saveXML(); bool saveAs( const QUrl &url ); /// Check if we have documents open for editing before saving virtual bool completeSaving( KoStore* store ); /// Extract document file from the store to disk QUrl extractFile( const Document *doc ); //Config &config() { return m_config; } /// Open Calligra document for editing // DocumentChild *openCalligraDocument( KMimeType::Ptr mimetype, const Document *doc ); /// Open KParts document for editing // DocumentChild *openKPartsDocument( KService::Ptr service, const Document *doc ); /// Open document for editing, return true if ok, false if failure bool editWorkpackageDocument( const Document *doc ); /// Open document for editing, return true if ok, false if failure bool editOtherDocument( const Document *doc ); /// Remove the document @p doc from its workpackage bool removeDocument( Document *doc ); /// Remove the child document // void removeChildDocument( DocumentChild *child ); /// Find the child that handles document @p doc DocumentChild *findChild( const Document *doc ) const; /// Add @p child document to work package @p wp // void addChild( WorkPackage *wp, DocumentChild *child ); /// Number of workpackages int workPackageCount() const { return m_packageMap.count(); } /// Work package at index WorkPackage *workPackage( int index ) const { return m_packageMap.values().value( index ); } /// Work package containing node WorkPackage *workPackage( Node *node ) const { return m_packageMap.value( node->projectNode()->id() + node->id() ); } int indexOf( WorkPackage *package ) const { return m_packageMap.values().indexOf( package ); } void addWorkPackage( WorkPackage *wp ); void removeWorkPackage( WorkPackage *wp ); void removeWorkPackage( Node *node, MacroCommand *m = 0 ); void removeWorkPackages( const QList &nodes ); /// Find the work package that handles document @p doc WorkPackage *findWorkPackage( const Document *doc ) const; /// Find the work package that handles document child @p child WorkPackage *findWorkPackage( const DocumentChild *child ) const; /// Find the work package that handles @p node WorkPackage *findWorkPackage( const Node *node ) const; /// Save all work packages bool saveWorkPackages( bool silent ); Node *node() const; bool queryClose(); bool openFile(); bool saveFile(); KUndo2QStack *undoStack() const { return m_undostack; } int commandIndex() const { return m_undostack->index(); } public Q_SLOTS: /** * Called by the undo stack when the document is saved or all changes has been undone * @param clean if the document's undo stack is clean or not */ virtual void setDocumentClean(bool clean); virtual void setModified( bool mod ); void saveModifiedWorkPackages(); void saveWorkPackage( WorkPackage *wp ); void addCommand( KUndo2Command *cmd ); void viewWorkpackageDocument( Document *doc ); Q_SIGNALS: void changed(); void workPackageAdded( WorkPackage *package, int index ); void workPackageRemoved( WorkPackage *wp, int index ); void captionChanged( const QString&, bool ); protected: /// Load the old kplato format bool loadKPlatoXML( const KoXmlDocument &document, KoStore *store ); /// Adds work package @p wp to the list of workpackages. /// If it already exists, the user is asked if it shall be merged with the existing one. bool setWorkPackage( WorkPackage *wp, KoStore *store = 0 ); bool completeLoading( KoStore *store ); bool loadAndParse(KoStore* store, const QString& filename, KoXmlDocument& doc); bool loadNativeFormatFromStore(const QString& file); bool loadNativeFormatFromStoreInternal(KoStore * store); bool viewDocument( const QUrl &filename ); private: XMLLoaderObject m_xmlLoader; //Config m_config; QMap m_packageMap; bool m_modified; bool m_loadingFromProjectStore; KUndo2QStack *m_undostack; }; } //KPlatoWork namespace #endif diff --git a/src/workpackage/taskcompletiondialog.h b/src/workpackage/taskcompletiondialog.h index ba05291e..a456dcc0 100644 --- a/src/workpackage/taskcompletiondialog.h +++ b/src/workpackage/taskcompletiondialog.h @@ -1,136 +1,136 @@ /* This file is part of the KDE project Copyright (C) 2009, 2011 Dag Andersen This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KPLATOWORK_TASKCOMPLETIONDIALOG_H #define KPLATOWORK_TASKCOMPLETIONDIALOG_H -#include "kplatowork_export.h" +#include "planwork_export.h" #include "ui_taskcompletionpanel.h" #include "workpackage.h" #include "kptusedefforteditor.h" #include #include class KUndo2Command; namespace KPlato { class ScheduleManager; } namespace KPlatoWork { class TaskCompletionPanel; -class KPLATOWORK_EXPORT TaskCompletionDialog : public KoDialog +class PLANWORK_EXPORT TaskCompletionDialog : public KoDialog { Q_OBJECT public: explicit TaskCompletionDialog( WorkPackage &p, ScheduleManager *sm, QWidget *parent=0 ); KUndo2Command *buildCommand(); protected Q_SLOTS: void slotChanged( bool ); private: TaskCompletionPanel *m_panel; }; -class KPLATOWORK_EXPORT TaskCompletionPanel : public QWidget, public Ui::TaskCompletionPanel +class PLANWORK_EXPORT TaskCompletionPanel : public QWidget, public Ui::TaskCompletionPanel { Q_OBJECT public: explicit TaskCompletionPanel( WorkPackage &p, ScheduleManager *sm, QWidget *parent=0 ); KUndo2Command *buildCommand(); void enableWidgets(); QSize sizeHint() const; Q_SIGNALS: void changed( bool ); public Q_SLOTS: void slotChanged(); void slotStartedChanged(bool state); void slotFinishedChanged(bool state); void slotPercentFinishedChanged(int value); void slotStartTimeChanged( const QDateTime &dt ); void slotFinishTimeChanged( const QDateTime &dt ); void slotAddEntry(); void slotEntryChanged(); void slotSelectionChanged( const QItemSelection &sel ); void slotEntryAdded( const QDate& date ); void slotEditmodeChanged( int ); protected Q_SLOTS: void slotCalculateEffort(); protected: void setFinished(); WorkPackage *m_package; Completion m_completion; int m_dayLength; Duration scheduledEffort; }; class CompletionEntryItemModel : public KPlato::CompletionEntryItemModel { Q_OBJECT public: enum Properties { Property_Date = KPlato::CompletionEntryItemModel::Property_Date, Property_Completion = KPlato::CompletionEntryItemModel::Property_Completion, Property_ActualEffort = KPlato::CompletionEntryItemModel::Property_UsedEffort, Property_RemainigEffort = KPlato::CompletionEntryItemModel::Property_RemainingEffort, Property_PlannedEffort = KPlato::CompletionEntryItemModel::Property_PlannedEffort, Property_ActualAccumulated }; explicit CompletionEntryItemModel(QObject *parent = 0); int columnCount( const QModelIndex &idx = QModelIndex() ) const; QVariant data( const QModelIndex &idx, int role ) const; bool setData( const QModelIndex &idx, const QVariant &value, int role ); void setSource( Resource *resource, Task *task ); protected: virtual QVariant actualEffort( int row, int role ) const; private: bool m_calculate; // opens for calculating used-/remaining effort Resource *m_resource; Task *m_task; }; } //KPlatoWork namespace #endif diff --git a/src/workpackage/taskworkpackagemodel.h b/src/workpackage/taskworkpackagemodel.h index 6c1ed834..fdd853a0 100644 --- a/src/workpackage/taskworkpackagemodel.h +++ b/src/workpackage/taskworkpackagemodel.h @@ -1,176 +1,176 @@ /* This file is part of the KDE project Copyright (C) 2009, 2011 Dag Andersen This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef TASKWORKPACKAGEMODEL_H #define TASKWORKPACKAGEMODEL_H -#include "kplatowork_export.h" +#include "planwork_export.h" #include "kptitemmodelbase.h" #include "kptnodeitemmodel.h" #include "kptschedule.h" #include class QModelIndex; class QAbstractItemDelegate; namespace KPlato { class Project; class Node; class Resource; class Document; } using namespace KPlato; /// The main namespace namespace KPlatoWork { class Part; class WorkPackage; /** * The TaskWorkPackageModel class gives access to workpackage status * for the resources assigned to the task in this package. * * The model stores a nodes parentNode() in the index's internalPointer(). */ -class KPLATOWORK_EXPORT TaskWorkPackageModel : public ItemModelBase +class PLANWORK_EXPORT TaskWorkPackageModel : public ItemModelBase { Q_OBJECT Q_ENUMS( Properties ) public: explicit TaskWorkPackageModel( Part *part, QObject *parent = 0 ); ~TaskWorkPackageModel() {} enum Properties { NodeName = 0, NodeType, NodeResponsible, NodeDescription, // After scheduling NodeStartTime, NodeEndTime, NodeAssignments, // Completion NodeCompleted, NodeActualEffort, NodeRemainingEffort, NodePlannedEffort, NodeActualStart, NodeStarted, NodeActualFinish, NodeFinished, NodeStatus, NodeStatusNote, ProjectName, ProjectManager }; const QMetaEnum columnMap() const { return metaObject()->enumerator( metaObject()->indexOfEnumerator("Properties") ); } WorkPackage *workPackage( int index ) const; virtual Qt::ItemFlags flags( const QModelIndex &index ) const; virtual QModelIndex parent( const QModelIndex &index ) const; virtual QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const; virtual QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const; virtual bool setData( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole ); QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const; virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const; virtual int columnCount( const QModelIndex &index = QModelIndex() ) const; Node *nodeForIndex( const QModelIndex &index ) const; QModelIndex indexForNode( Node *node ) const; QAbstractItemDelegate *createDelegate( int column, QWidget *parent ) const; Document *documentForIndex( const QModelIndex &idx ) const; WorkPackage *ptrToWorkPackage( const QModelIndex &idx ) const; Node *ptrToNode( const QModelIndex &idx ) const; bool isNode( const QModelIndex &idx ) const; bool isDocument( const QModelIndex &idx ) const; public Q_SLOTS: void addWorkPackage( WorkPackage *package, int row ); void removeWorkPackage( WorkPackage *package, int row ); protected Q_SLOTS: void slotNodeChanged( Node* ); void slotNodeToBeInserted( Node *node, int row ); void slotNodeInserted( Node *node ); void slotNodeToBeRemoved( Node *node ); void slotNodeRemoved( Node *node ); void slotDocumentAdded( Node *node, Document *doc, int index ); void slotDocumentRemoved( Node *node, Document *doc, int index ); void slotDocumentChanged( Node *node, Document *doc, int index ); protected: QVariant nodeData( Node *node, int column, int role ) const; QVariant documentData( Document *doc, int column, int role ) const; QVariant name( const Resource *r, int role ) const; QVariant email( const Resource *r, int role ) const; QVariant sendStatus( const Resource *r, int role ) const; QVariant sendTime( const Resource *r, int role ) const; QVariant responseType( const Resource *r, int role ) const; QVariant requiredTime( const Resource *r, int role ) const; QVariant responseStatus( const Resource *r, int role ) const; QVariant responseTime( const Resource *r, int role ) const; QVariant lastAction( const Resource *r, int role ) const; QVariant projectName( const Node *n, int role ) const; QVariant projectManager( const Node *n, int role ) const; bool setCompletion( Node *node, const QVariant &value, int role ); bool setRemainingEffort( Node *node, const QVariant &value, int role ); bool setActualEffort( Node *node, const QVariant &value, int role ); bool setStartedTime( Node *node, const QVariant &value, int role ); bool setFinishedTime( Node *node, const QVariant &value, int role ); QVariant actualStart( Node *n, int role ) const; QVariant actualFinish( Node *n, int role ) const; QVariant plannedEffort( Node *n, int role ) const; QVariant status( Node *n, int role ) const; private: NodeModel m_nodemodel; Part *m_part; }; } //namespace KPlato #endif //WORKPACKAGEMODEL_H diff --git a/src/workpackage/taskworkpackageview.h b/src/workpackage/taskworkpackageview.h index e9355f51..be036988 100644 --- a/src/workpackage/taskworkpackageview.h +++ b/src/workpackage/taskworkpackageview.h @@ -1,260 +1,260 @@ /* This file is part of the KDE project Copyright (C) 2007 - 2009 Dag Andersen This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef TASKWORKPACKAGEVIEW_H #define TASKWORKPACKAGEVIEW_H -#include "kplatowork_export.h" +#include "planwork_export.h" #include "kptitemmodelbase.h" #include "kptviewbase.h" #include "kptganttview.h" #include #include class QItemSelection; namespace KPlato { class Project; class Node; class Document; } using namespace KPlato; namespace KPlatoWork { class Part; class WorkPackage; class TaskWorkPackageModel; -class KPLATOWORK_EXPORT TaskWorkPackageTreeView : public DoubleTreeViewBase +class PLANWORK_EXPORT TaskWorkPackageTreeView : public DoubleTreeViewBase { Q_OBJECT public: TaskWorkPackageTreeView( Part *part, QWidget *parent ); //void setSelectionModel( QItemSelectionModel *selectionModel ); TaskWorkPackageModel *itemModel() const; Project *project() const; void setProject( Project *project ); Document *currentDocument() const; Node *currentNode() const; QList selectedNodes() const; Q_SIGNALS: void sectionsMoved(); protected Q_SLOTS: void slotActivated( const QModelIndex &index ); void setSortOrder( int col, Qt::SortOrder order ); protected: void dragMoveEvent(QDragMoveEvent *event); }; -class KPLATOWORK_EXPORT AbstractView : public QWidget, public ViewActionLists +class PLANWORK_EXPORT AbstractView : public QWidget, public ViewActionLists { Q_OBJECT public: AbstractView( Part *part, QWidget *parent ); /// reimplement virtual void updateReadWrite( bool readwrite ); /// reimplement virtual Node *currentNode() const; /// reimplement virtual Document *currentDocument() const; /// reimplement virtual QList selectedNodes() const; /// Loads context info into this view. Reimplement. virtual bool loadContext(); /// Save context info from this view. Reimplement. virtual void saveContext(); /// reimplement virtual KoPrintJob *createPrintJob(); Q_SIGNALS: void requestPopupMenu( const QString& name, const QPoint &pos ); void selectionChanged(); protected Q_SLOTS: /// Builds menu from action list virtual void slotHeaderContextMenuRequested( const QPoint &pos ); /// Reimplement if you have index specific context menu, standard calls slotHeaderContextMenuRequested() void slotContextMenuRequested( const QModelIndex &index, const QPoint& pos ); /// Should not need to be reimplemented virtual void slotContextMenuRequested( Node *node, const QPoint& pos ); /// Should not need to be reimplemented virtual void slotContextMenuRequested( Document *doc, const QPoint& pos ); /// Calls saveContext(), connect to this to have configuration saved virtual void sectionsMoved(); protected: Part *m_part; }; -class KPLATOWORK_EXPORT TaskWorkPackageView : public AbstractView +class PLANWORK_EXPORT TaskWorkPackageView : public AbstractView { Q_OBJECT public: TaskWorkPackageView( Part *part, QWidget *parent ); void setupGui(); TaskWorkPackageModel *itemModel() const { return m_view->itemModel(); } void updateReadWrite( bool readwrite ); Node *currentNode() const; Document *currentDocument() const; QList selectedNodes() const; /// Loads context info into this view. Reimplement. virtual bool loadContext(); /// Save context info from this view. Reimplement. virtual void saveContext(); using AbstractView::slotContextMenuRequested; protected Q_SLOTS: void slotOptions(); void slotSplitView(); void slotContextMenuRequested( const QModelIndex &index, const QPoint& pos ); void slotSelectionChanged( const QModelIndexList &lst ); protected: void updateActionsEnabled( bool on ); private: TaskWorkPackageTreeView *m_view; }; //------------- class GanttItemDelegate : public KPlato::GanttItemDelegate { Q_OBJECT public: enum Brushes { Brush_Normal, Brush_Late, Brush_NotScheduled, Brush_Finished, Brush_NotReadyToStart, Brush_ReadyToStart }; explicit GanttItemDelegate(QObject *parent = 0); void paintGanttItem( QPainter* painter, const KGantt::StyleOptionGanttItem& opt, const QModelIndex& idx ); QString toolTip( const QModelIndex &idx ) const; protected: bool showStatus; QMap m_brushes; }; class GanttView : public KPlato::GanttViewBase { Q_OBJECT public: GanttView( Part *part, QWidget *parent ); ~GanttView(); TaskWorkPackageModel *itemModel() const; void setProject( Project *project ); Project *project() const { return m_project; } GanttItemDelegate *delegate() const { return m_ganttdelegate; } QList selectedNodes() const; Node *currentNode() const; /// Loads context info into this view. Reimplement. virtual bool loadContext( const KoXmlElement &context ); /// Save context info from this view. Reimplement. virtual void saveContext( QDomElement &context ) const; Q_SIGNALS: void headerContextMenuRequested( const QPoint& ); void contextMenuRequested( const QModelIndex&, const QPoint& ); void selectionChanged( const QModelIndexList& ); void sectionsMoved(); protected Q_SLOTS: void slotSelectionChanged( const QItemSelection &selected, const QItemSelection &deselected ); void slotRowsInserted( const QModelIndex &parent, int start, int end ); void slotRowsRemoved( const QModelIndex &parent, int start, int end ); void updateDateTimeGrid( WorkPackage *wp ); protected: Part *m_part; Project *m_project; GanttItemDelegate *m_ganttdelegate; TaskWorkPackageModel *m_itemmodel; KGantt::TreeViewRowController *m_rowController; }; -class KPLATOWORK_EXPORT TaskWPGanttView : public AbstractView +class PLANWORK_EXPORT TaskWPGanttView : public AbstractView { Q_OBJECT public: TaskWPGanttView( Part *part, QWidget *parent ); void setupGui(); TaskWorkPackageModel *itemModel() const { return m_view->itemModel(); } Node *currentNode() const; QList selectedNodes() const; /// Loads context info into this view. Reimplement. virtual bool loadContext(); /// Save context info from this view. Reimplement. virtual void saveContext(); using AbstractView::slotContextMenuRequested; protected Q_SLOTS: void slotContextMenuRequested( const QModelIndex &index, const QPoint& pos ); void slotSelectionChanged( const QModelIndexList &lst ); void slotOptions(); private: GanttView *m_view; }; } //namespace KPlatoWork #endif