LCOV - code coverage report
Current view: top level - include/sfx2 - templatedlg.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 0 1 0.0 %
Date: 2014-11-03 Functions: 0 1 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  */
       9             : 
      10             : #ifndef INCLUDED_SFX2_INC_TEMPLATEDLG_HXX
      11             : #define INCLUDED_SFX2_INC_TEMPLATEDLG_HXX
      12             : 
      13             : #include <sal/config.h>
      14             : #include <sfx2/dllapi.h>
      15             : 
      16             : #include <set>
      17             : 
      18             : #include <vcl/dialog.hxx>
      19             : #include <vcl/button.hxx>
      20             : #include <vcl/tabctrl.hxx>
      21             : #include <vcl/tabpage.hxx>
      22             : #include <com/sun/star/frame/XDesktop2.hpp>
      23             : 
      24             : #include <sfx2/templateabstractview.hxx>
      25             : 
      26             : class Edit;
      27             : class PopupMenu;
      28             : class SfxTemplateInfoDlg;
      29             : class TemplateAbstractView;
      30             : class TemplateLocalView;
      31             : class TemplateRemoteView;
      32             : class TemplateRepository;
      33             : class TemplateSearchView;
      34             : class ThumbnailView;
      35             : class ThumbnailViewItem;
      36             : class ToolBox;
      37             : 
      38             : namespace com {
      39             :     namespace sun { namespace star { namespace frame {
      40             :         class XComponentLoader;
      41             :         class XModel;
      42             :     }   }   }
      43             : }
      44             : 
      45             : class SFX2_DLLPUBLIC SfxTemplateManagerDlg : public ModalDialog
      46             : {
      47             :     typedef bool (*selection_cmp_fn)(const ThumbnailViewItem*,const ThumbnailViewItem*);
      48             : 
      49             : public:
      50             : 
      51             :     SfxTemplateManagerDlg(vcl::Window *parent = NULL);
      52             : 
      53             :     virtual ~SfxTemplateManagerDlg ();
      54             : 
      55             :     void setSaveMode();
      56             : 
      57             :     void setDocumentModel (const com::sun::star::uno::Reference<com::sun::star::frame::XModel> &rModel);
      58             : 
      59             :     DECL_LINK(ActivatePageHdl, void*);
      60             : 
      61             : private:
      62             : 
      63             :     void readSettings ();
      64             : 
      65             :     void writeSettings ();
      66             : 
      67             :     DECL_LINK(TBXViewHdl, void*);
      68             :     DECL_LINK(TBXActionHdl, void*);
      69             :     DECL_LINK(TBXTemplateHdl, void*);
      70             :     DECL_LINK(TBXDropdownHdl, ToolBox*);
      71             : 
      72             :     DECL_LINK(TVItemStateHdl, const ThumbnailViewItem*);
      73             : 
      74             :     DECL_LINK(MenuSelectHdl, Menu*);
      75             :     DECL_LINK(MoveMenuSelectHdl, Menu*);
      76             :     DECL_LINK(RepositoryMenuSelectHdl, Menu*);
      77             :     DECL_LINK(DefaultTemplateMenuSelectHdl, Menu*);
      78             : 
      79             :     DECL_LINK(OpenRegionHdl, void*);
      80             :     DECL_LINK(OpenTemplateHdl, ThumbnailViewItem*);
      81             : 
      82             :     DECL_LINK(SearchUpdateHdl, void*);
      83             : 
      84             :     void OnTemplateImport ();
      85             :     void OnTemplateSearch ();
      86             :     void OnTemplateLink ();
      87             :     void OnTemplateOpen ();
      88             :     void OnTemplateEdit ();
      89             :     void OnTemplateProperties ();
      90             :     void OnTemplateDelete ();
      91             :     void OnTemplateAsDefault ();
      92             :     void OnTemplateExport ();
      93             : 
      94             :     void OnTemplateState (const ThumbnailViewItem *pItem);
      95             : 
      96             :     void OnFolderNew ();
      97             :     void OnFolderDelete ();
      98             : 
      99             :     void OnRegionState (const ThumbnailViewItem *pItem);
     100             : 
     101             :     void OnRepositoryDelete ();
     102             :     void OnTemplateSaveAs ();
     103             : 
     104             :     void createRepositoryMenu ();
     105             : 
     106             :     void createDefaultTemplateMenu ();
     107             : 
     108             :     // Exchange view between local/online view.
     109             :     void switchMainView (bool bDisplayLocal);
     110             : 
     111             :     /**
     112             :      *
     113             :      * Move templates stored in the filesystem to another folder.
     114             :      *
     115             :      **/
     116             : 
     117             :     void localMoveTo (sal_uInt16 nMenuId);
     118             : 
     119             :     void remoteMoveTo (const sal_uInt16 nMenuId);
     120             : 
     121             :     /**
     122             :      *
     123             :      * Move search result templates stored in the filesystem to another folder.
     124             :      *
     125             :      **/
     126             : 
     127             :     void localSearchMoveTo (sal_uInt16 nMenuId);
     128             : 
     129             :     // Remote repositories handling methods
     130             :     void loadRepositories ();
     131             : 
     132           0 :     const std::vector<TemplateRepository*>& getRepositories () const { return maRepositories; }
     133             : 
     134             :     bool insertRepository (const OUString &rName, const OUString &rURL);
     135             : 
     136             :     bool deleteRepository (const sal_uInt16 nRepositoryId);
     137             : 
     138             :     void syncRepositories () const;
     139             : 
     140             :     /// Return filter according to the currently selected tab page.
     141             :     FILTER_APPLICATION getCurrentFilter();
     142             : 
     143             : private:
     144             : 
     145             :     TabControl *mpTabControl;
     146             : 
     147             :     Edit *mpSearchEdit;
     148             :     ToolBox *mpViewBar;
     149             :     ToolBox *mpActionBar;
     150             :     ToolBox *mpTemplateBar;
     151             :     TemplateSearchView *mpSearchView;
     152             :     TemplateAbstractView *mpCurView;
     153             :     TemplateLocalView *mpLocalView;
     154             :     TemplateRemoteView *mpRemoteView;
     155             :     PopupMenu *mpActionMenu;
     156             :     PopupMenu *mpRepositoryMenu;
     157             :     PopupMenu *mpTemplateDefaultMenu;
     158             : 
     159             :     std::set<const ThumbnailViewItem*,selection_cmp_fn> maSelTemplates;
     160             :     std::set<const ThumbnailViewItem*,selection_cmp_fn> maSelFolders;
     161             : 
     162             :     bool mbIsSaveMode;  ///< Flag that indicates if we are in save mode or not.
     163             :     com::sun::star::uno::Reference< com::sun::star::frame::XModel > m_xModel;
     164             :     com::sun::star::uno::Reference< com::sun::star::frame::XDesktop2 > mxDesktop;
     165             : 
     166             :     bool mbIsSynced; ///< Tells whether maRepositories is synchronized with the user config
     167             :     std::vector<TemplateRepository*> maRepositories; ///< Stores the remote repositories for templates
     168             : };
     169             : 
     170             : #endif // INCLUDED_SFX2_INC_TEMPLATEDLG_HXX
     171             : 
     172             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10