LCOV - code coverage report
Current view: top level - libreoffice/solver/unxlngi6.pro/inc/svx - galtheme.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 5 0.0 %
Date: 2012-12-27 Functions: 0 5 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             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #ifndef _SVX_GALTHEME_HXX_
      21             : #define _SVX_GALTHEME_HXX_
      22             : 
      23             : #include "svx/svxdllapi.h"
      24             : 
      25             : #include <tools/debug.hxx>
      26             : #include <tools/urlobj.hxx>
      27             : #include <vcl/salctype.hxx>
      28             : #include <svl/brdcst.hxx>
      29             : #include <svl/lstner.hxx>
      30             : #include <svtools/transfer.hxx>
      31             : #include <sot/storage.hxx>
      32             : #include <svx/svdmodel.hxx>
      33             : #include <svx/galmisc.hxx>
      34             : #include <vector>
      35             : 
      36             : // -----------------
      37             : // - GalleryObject -
      38             : // -----------------
      39             : // --------------
      40             : // - SgaObjKind -
      41             : // --------------
      42             : 
      43             : struct GalleryObject
      44             : {
      45             :     INetURLObject   aURL;
      46             :     sal_uInt32      nOffset;
      47             :     SgaObjKind      eObjKind;
      48             :     sal_Bool            bDummy;
      49             : };
      50             : 
      51             : typedef ::std::vector< GalleryObject* > GalleryObjectList;
      52             : 
      53             : class GalleryThemeEntry;
      54             : class SgaObject;
      55             : class FmFormModel;
      56             : class ListBox;
      57             : 
      58             : // -----------------
      59             : // - GalDragParams -
      60             : // -----------------
      61             : 
      62             : struct GalDragParams
      63             : {
      64             :     Region  aDragRegion;
      65             :     sal_uIntPtr nDragObjPos;
      66             :     rtl::OUString aThemeName;
      67             :     rtl::OUString aFileName;
      68             :     SgaObjKind  eObjKind;
      69             : };
      70             : 
      71             : // ----------------
      72             : // - GalleryTheme -
      73             : // ----------------
      74             : 
      75             : class Gallery;
      76             : class GalleryProgress;
      77             : namespace unogallery
      78             : {
      79             :     class GalleryTheme;
      80             :     class GalleryItem;
      81             : }
      82             : 
      83             : class GalleryTheme : public SfxBroadcaster
      84             : {
      85             :     friend class Gallery;
      86             :     friend class GalleryThemeCacheEntry;
      87             :     friend class ::unogallery::GalleryTheme;
      88             :     friend class ::unogallery::GalleryItem;
      89             : 
      90             : private:
      91             : 
      92             :     GalleryObjectList           aObjectList;
      93             :     String                      m_aDestDir;
      94             :     SotStorageRef               aSvDrawStorageRef;
      95             :     Gallery*                    pParent;
      96             :     GalleryThemeEntry*          pThm;
      97             :     sal_uIntPtr                       mnThemeLockCount;
      98             :     sal_uIntPtr                     mnBroadcasterLockCount;
      99             :     sal_uIntPtr                     nDragPos;
     100             :     sal_Bool                        bDragging;
     101             :     sal_Bool                        bAbortActualize;
     102             : 
     103             :     void                        ImplCreateSvDrawStorage();
     104             :     SVX_DLLPUBLIC SgaObject*                    ImplReadSgaObject( GalleryObject* pEntry );
     105             :     sal_Bool                    ImplWriteSgaObject( const SgaObject& rObj, size_t nPos, GalleryObject* pExistentEntry );
     106             :     void                        ImplWrite();
     107             :     const GalleryObject*        ImplGetGalleryObject( size_t nPos ) const
     108             :                                 { return ( nPos < aObjectList.size() ) ? aObjectList[ nPos ] : NULL; }
     109             :     SVX_DLLPUBLIC const GalleryObject*      ImplGetGalleryObject( const INetURLObject& rURL );
     110             : 
     111             :     size_t                      ImplGetGalleryObjectPos( const GalleryObject* pObj ) const
     112             :                                 {
     113             :                                     for ( size_t i = 0, n = aObjectList.size(); i < n; ++i )
     114             :                                         if ( pObj == aObjectList[ i ] )
     115             :                                             return i;
     116             :                                     return size_t(-1);
     117             :                                 }
     118             :     INetURLObject               ImplGetURL( const GalleryObject* pObject ) const;
     119             :     INetURLObject               ImplCreateUniqueURL( SgaObjKind eObjKind, sal_uIntPtr nFormat = CVT_UNKNOWN );
     120             :     void                        ImplSetModified( sal_Bool bModified );
     121             :     void                        ImplBroadcast( sal_uIntPtr nUpdatePos );
     122             : 
     123             :                                 GalleryTheme();
     124             :                                 GalleryTheme( Gallery* pGallery, GalleryThemeEntry* pThemeEntry );
     125             :                                 ~GalleryTheme();
     126             : 
     127             : public:
     128             : 
     129             :     static GalleryThemeEntry*   CreateThemeEntry( const INetURLObject& rURL, sal_Bool bReadOnly );
     130             : 
     131           0 :     size_t                      GetObjectCount() const { return aObjectList.size(); }
     132             : 
     133             :     SVX_DLLPUBLIC SgaObject*    AcquireObject( size_t nPos );
     134             :     SVX_DLLPUBLIC void          ReleaseObject( SgaObject* pObj );
     135             : 
     136             :     SVX_DLLPUBLIC bool          InsertObject( const SgaObject& rObj, sal_uIntPtr nPos = LIST_APPEND );
     137             :     SVX_DLLPUBLIC bool          RemoveObject( size_t nPos );
     138             :     bool                        ChangeObjectPos( size_t nOldPos, size_t nNewPos );
     139             : 
     140             :     SVX_DLLPUBLIC const rtl::OUString& GetName() const;
     141             :     const rtl::OUString&        GetRealName() const;
     142             : 
     143             :     const String&               GetDestDir() const { return m_aDestDir; }
     144           0 :     void                        SetDestDir(const String& rDestDir) { m_aDestDir = rDestDir; }
     145             : 
     146             :     const INetURLObject&        GetThmURL() const;
     147             :     SVX_DLLPUBLIC const INetURLObject&      GetSdgURL() const;
     148             :     const INetURLObject&        GetSdvURL() const;
     149             : 
     150             :     SVX_DLLPUBLIC sal_uInt32        GetId() const;
     151             :     void                        SetId( sal_uInt32 nNewId, sal_Bool bResetThemeName );
     152             : 
     153             :     void                        SetDragging( sal_Bool bSet ) { bDragging = bSet; }
     154             :     sal_Bool                        IsDragging() const { return bDragging; }
     155             : 
     156             :     void                        LockTheme() { ++mnThemeLockCount; }
     157             :     sal_Bool                        UnlockTheme();
     158             : 
     159           0 :     void                        LockBroadcaster() { mnBroadcasterLockCount++; }
     160             :     SVX_DLLPUBLIC void          UnlockBroadcaster( sal_uIntPtr nUpdatePos = 0 );
     161             :     sal_Bool                        IsBroadcasterLocked() const { return mnBroadcasterLockCount > 0; }
     162             : 
     163             :     void                        SetDragPos( sal_uIntPtr nPos ) { nDragPos = nPos; }
     164             :     sal_uIntPtr                     GetDragPos() const { return nDragPos; }
     165             : 
     166             :     sal_Bool                        IsThemeNameFromResource() const;
     167             : 
     168             :     SVX_DLLPUBLIC sal_Bool          IsReadOnly() const;
     169             :     SVX_DLLPUBLIC sal_Bool          IsDefault() const;
     170             :     sal_Bool                        IsModified() const;
     171             : 
     172             :     SVX_DLLPUBLIC void                      Actualize( const Link& rActualizeLink, GalleryProgress* pProgress = NULL );
     173           0 :     void                        AbortActualize() { bAbortActualize = sal_True; }
     174             : 
     175           0 :     Gallery*                    GetParent() const { return pParent; }
     176             :     SotStorageRef               GetSvDrawStorage() const { return aSvDrawStorageRef; }
     177             : 
     178             : public:
     179             : 
     180             :     SgaObjKind                  GetObjectKind( sal_uIntPtr nPos ) const
     181             :                                 {
     182             :                                     DBG_ASSERT( nPos < GetObjectCount(), "Position out of range" );
     183             :                                     return ImplGetGalleryObject( nPos )->eObjKind;
     184             :                                 }
     185             : 
     186             : 
     187             :     const INetURLObject&        GetObjectURL( sal_uIntPtr nPos ) const
     188             :                                 {
     189             :                                     DBG_ASSERT( nPos < GetObjectCount(), "Position out of range" );
     190             :                                     return ImplGetGalleryObject( nPos )->aURL;
     191             :                                 }
     192             : 
     193             :     sal_Bool                        GetThumb( sal_uIntPtr nPos, Bitmap& rBmp, sal_Bool bProgress = sal_False );
     194             : 
     195             :     SVX_DLLPUBLIC sal_Bool                      GetGraphic( sal_uIntPtr nPos, Graphic& rGraphic, sal_Bool bProgress = sal_False );
     196             :     SVX_DLLPUBLIC sal_Bool                      InsertGraphic( const Graphic& rGraphic, sal_uIntPtr nInsertPos = LIST_APPEND );
     197             : 
     198             :     SVX_DLLPUBLIC sal_Bool                      GetModel( sal_uIntPtr nPos, SdrModel& rModel, sal_Bool bProgress = sal_False );
     199             :     SVX_DLLPUBLIC sal_Bool                      InsertModel( const FmFormModel& rModel, sal_uIntPtr nInsertPos = LIST_APPEND );
     200             : 
     201             :     sal_Bool                        GetModelStream( sal_uIntPtr nPos, SotStorageStreamRef& rModelStreamRef, sal_Bool bProgress = sal_False );
     202             :     sal_Bool                        InsertModelStream( const SotStorageStreamRef& rModelStream, sal_uIntPtr nInsertPos = LIST_APPEND );
     203             : 
     204             :     sal_Bool                        GetURL( sal_uIntPtr nPos, INetURLObject& rURL, sal_Bool bProgress = sal_False );
     205             :     SVX_DLLPUBLIC sal_Bool                      InsertURL( const INetURLObject& rURL, sal_uIntPtr nInsertPos = LIST_APPEND );
     206             :     sal_Bool                        InsertFileOrDirURL( const INetURLObject& rFileOrDirURL, sal_uIntPtr nInsertPos = LIST_APPEND );
     207             : 
     208             :     sal_Bool                        InsertTransferable( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rxTransferable, sal_uIntPtr nInsertPos );
     209             : 
     210             :     void                        CopyToClipboard( Window* pWindow, sal_uIntPtr nPos );
     211             :     void                        StartDrag( Window* pWindow, sal_uIntPtr nPos );
     212             : 
     213             : public:
     214             : 
     215             :     SvStream&                   WriteData( SvStream& rOut ) const;
     216             :     SvStream&                   ReadData( SvStream& rIn );
     217             :     static SVX_DLLPUBLIC void   InsertAllThemes( ListBox& rListBox );
     218             : };
     219             : 
     220             : SvStream& operator<<( SvStream& rOut, const GalleryTheme& rTheme );
     221             : SvStream& operator>>( SvStream& rIn, GalleryTheme& rTheme );
     222             : 
     223             : #endif
     224             : 
     225             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10