LCOV - code coverage report
Current view: top level - svx/inc/svx/sdr/contact - viewcontactofsdrpage.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 4 4 100.0 %
Date: 2012-08-25 Functions: 3 3 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           Branch data     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 _SDR_CONTACT_VIEWCONTACTOFSDRPAGE_HXX
      21                 :            : #define _SDR_CONTACT_VIEWCONTACTOFSDRPAGE_HXX
      22                 :            : 
      23                 :            : #include <sal/types.h>
      24                 :            : #include <svx/sdr/contact/viewcontact.hxx>
      25                 :            : 
      26                 :            : //////////////////////////////////////////////////////////////////////////////
      27                 :            : // predeclarations
      28                 :            : class SdrPage;
      29                 :            : 
      30                 :            : namespace sdr { namespace contact {
      31                 :            :     class ViewContactOfSdrPage;
      32                 :            : }}
      33                 :            : 
      34                 :            : //////////////////////////////////////////////////////////////////////////////
      35                 :            : 
      36                 :            : namespace sdr
      37                 :            : {
      38                 :            :     namespace contact
      39                 :            :     {
      40                 :            :         class ViewContactOfPageSubObject : public ViewContact
      41                 :            :         {
      42                 :            :         protected:
      43                 :            :             ViewContactOfSdrPage&                       mrParentViewContactOfSdrPage;
      44                 :            : 
      45                 :            :         public:
      46                 :            :             explicit ViewContactOfPageSubObject(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
      47                 :            :             virtual ~ViewContactOfPageSubObject();
      48                 :            : 
      49                 :            :             virtual ViewContact* GetParentContact() const;
      50                 :            :             const SdrPage& getPage() const;
      51                 :            :         };
      52                 :            :     } // end of namespace contact
      53                 :            : } // end of namespace sdr
      54                 :            : 
      55                 :            : //////////////////////////////////////////////////////////////////////////////
      56                 :            : 
      57                 :            : namespace sdr
      58                 :            : {
      59                 :            :     namespace contact
      60                 :            :     {
      61                 :            :         class ViewContactOfPageBackground : public ViewContactOfPageSubObject
      62                 :            :         {
      63                 :            :         protected:
      64                 :            :             virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
      65                 :            :             virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
      66                 :            : 
      67                 :            :         public:
      68                 :            :             explicit ViewContactOfPageBackground(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
      69                 :            :             virtual ~ViewContactOfPageBackground();
      70                 :            :         };
      71                 :            :     } // end of namespace contact
      72                 :            : } // end of namespace sdr
      73                 :            : 
      74                 :            : //////////////////////////////////////////////////////////////////////////////
      75                 :            : 
      76                 :            : namespace sdr
      77                 :            : {
      78                 :            :     namespace contact
      79                 :            :     {
      80                 :            :         class ViewContactOfPageShadow : public ViewContactOfPageSubObject
      81                 :            :         {
      82                 :            :         protected:
      83                 :            :             virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
      84                 :            :             virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
      85                 :            : 
      86                 :            :         public:
      87                 :            :             explicit ViewContactOfPageShadow(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
      88                 :            :             virtual ~ViewContactOfPageShadow();
      89                 :            :         };
      90                 :            :     } // end of namespace contact
      91                 :            : } // end of namespace sdr
      92                 :            : 
      93                 :            : //////////////////////////////////////////////////////////////////////////////
      94                 :            : 
      95                 :            : namespace sdr
      96                 :            : {
      97                 :            :     namespace contact
      98                 :            :     {
      99                 :            :         class ViewContactOfPageFill : public ViewContactOfPageSubObject
     100                 :            :         {
     101                 :            :         protected:
     102                 :            :             virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
     103                 :            :             virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
     104                 :            : 
     105                 :            :         public:
     106                 :            :             explicit ViewContactOfPageFill(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
     107                 :            :             virtual ~ViewContactOfPageFill();
     108                 :            :         };
     109                 :            :     } // end of namespace contact
     110                 :            : } // end of namespace sdr
     111                 :            : 
     112                 :            : //////////////////////////////////////////////////////////////////////////////
     113                 :            : 
     114                 :            : namespace sdr
     115                 :            : {
     116                 :            :     namespace contact
     117                 :            :     {
     118                 :            :         class ViewContactOfMasterPage : public ViewContactOfPageSubObject
     119                 :            :         {
     120                 :            :         protected:
     121                 :            :             virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
     122                 :            :             virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
     123                 :            : 
     124                 :            :         public:
     125                 :            :             explicit ViewContactOfMasterPage(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
     126                 :            :             virtual ~ViewContactOfMasterPage();
     127                 :            :         };
     128                 :            :     } // end of namespace contact
     129                 :            : } // end of namespace sdr
     130                 :            : 
     131                 :            : //////////////////////////////////////////////////////////////////////////////
     132                 :            : 
     133                 :            : namespace sdr
     134                 :            : {
     135                 :            :     namespace contact
     136                 :            :     {
     137                 :            :         class ViewContactOfOuterPageBorder : public ViewContactOfPageSubObject
     138                 :            :         {
     139                 :            :         protected:
     140                 :            :             virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
     141                 :            :             virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
     142                 :            : 
     143                 :            :         public:
     144                 :            :             explicit ViewContactOfOuterPageBorder(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
     145                 :            :             virtual ~ViewContactOfOuterPageBorder();
     146                 :            :         };
     147                 :            :     } // end of namespace contact
     148                 :            : } // end of namespace sdr
     149                 :            : 
     150                 :            : //////////////////////////////////////////////////////////////////////////////
     151                 :            : 
     152                 :            : namespace sdr
     153                 :            : {
     154                 :            :     namespace contact
     155                 :            :     {
     156                 :            :         class ViewContactOfInnerPageBorder : public ViewContactOfPageSubObject
     157                 :            :         {
     158                 :            :         protected:
     159                 :            :             virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
     160                 :            :             virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
     161                 :            : 
     162                 :            :         public:
     163                 :            :             explicit ViewContactOfInnerPageBorder(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
     164                 :            :             virtual ~ViewContactOfInnerPageBorder();
     165                 :            :         };
     166                 :            :     } // end of namespace contact
     167                 :            : } // end of namespace sdr
     168                 :            : 
     169                 :            : //////////////////////////////////////////////////////////////////////////////
     170                 :            : 
     171                 :            : namespace sdr
     172                 :            : {
     173                 :            :     namespace contact
     174                 :            :     {
     175                 :            :         class ViewContactOfPageHierarchy : public ViewContactOfPageSubObject
     176                 :            :         {
     177                 :            :         protected:
     178                 :            :             virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
     179                 :            :             virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
     180                 :            : 
     181                 :            :         public:
     182                 :            :             explicit ViewContactOfPageHierarchy(ViewContactOfSdrPage& rParentViewContactOfSdrPage);
     183                 :            :             virtual ~ViewContactOfPageHierarchy();
     184                 :            : 
     185                 :            :             virtual sal_uInt32 GetObjectCount() const;
     186                 :            :             virtual ViewContact& GetViewContact(sal_uInt32 nIndex) const;
     187                 :            :         };
     188                 :            :     } // end of namespace contact
     189                 :            : } // end of namespace sdr
     190                 :            : 
     191                 :            : //////////////////////////////////////////////////////////////////////////////
     192                 :            : 
     193                 :            : namespace sdr
     194                 :            : {
     195                 :            :     namespace contact
     196                 :            :     {
     197                 :            :         class ViewContactOfGrid : public ViewContactOfPageSubObject
     198                 :            :         {
     199                 :            :         protected:
     200                 :            :             // bitfield
     201                 :            :             unsigned                                    mbFront : 1;
     202                 :            : 
     203                 :            :             virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
     204                 :            :             virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
     205                 :            : 
     206                 :            :         public:
     207                 :            :             ViewContactOfGrid(ViewContactOfSdrPage& rParentViewContactOfSdrPage, bool bFront);
     208                 :            :             virtual ~ViewContactOfGrid();
     209                 :            : 
     210                 :        180 :             bool getFront() const { return mbFront; }
     211                 :            :         };
     212                 :            :     } // end of namespace contact
     213                 :            : } // end of namespace sdr
     214                 :            : 
     215                 :            : //////////////////////////////////////////////////////////////////////////////
     216                 :            : 
     217                 :            : namespace sdr
     218                 :            : {
     219                 :            :     namespace contact
     220                 :            :     {
     221                 :            :         class ViewContactOfHelplines : public ViewContactOfPageSubObject
     222                 :            :         {
     223                 :            :         protected:
     224                 :            :             // bitfield
     225                 :            :             unsigned                                    mbFront : 1;
     226                 :            : 
     227                 :            :             virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
     228                 :            :             virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
     229                 :            : 
     230                 :            :         public:
     231                 :            :             ViewContactOfHelplines(ViewContactOfSdrPage& rParentViewContactOfSdrPage, bool bFront);
     232                 :            :             virtual ~ViewContactOfHelplines();
     233                 :            : 
     234                 :        180 :             bool getFront() const { return mbFront; }
     235                 :            :         };
     236                 :            :     } // end of namespace contact
     237                 :            : } // end of namespace sdr
     238                 :            : 
     239                 :            : //////////////////////////////////////////////////////////////////////////////
     240                 :            : 
     241                 :            : namespace sdr
     242                 :            : {
     243                 :            :     namespace contact
     244                 :            :     {
     245                 :            :         class ViewContactOfSdrPage : public ViewContact
     246                 :            :         {
     247                 :            :         protected:
     248                 :            :             // the owner of this ViewContact. Set from constructor and not
     249                 :            :             // to be changed in any way.
     250                 :            :             SdrPage&                                        mrPage;
     251                 :            : 
     252                 :            :             // helper viewContacts to build a clear paint hierarchy
     253                 :            :             ViewContactOfPageBackground                     maViewContactOfPageBackground;
     254                 :            :             ViewContactOfPageShadow                         maViewContactOfPageShadow;
     255                 :            :             ViewContactOfPageFill                           maViewContactOfPageFill;
     256                 :            :             ViewContactOfMasterPage                         maViewContactOfMasterPage;
     257                 :            :             ViewContactOfOuterPageBorder                    maViewContactOfOuterPageBorder;
     258                 :            :             ViewContactOfInnerPageBorder                    maViewContactOfInnerPageBorder;
     259                 :            :             ViewContactOfGrid                               maViewContactOfGridBack;
     260                 :            :             ViewContactOfHelplines                          maViewContactOfHelplinesBack;
     261                 :            :             ViewContactOfPageHierarchy                      maViewContactOfPageHierarchy;
     262                 :            :             ViewContactOfGrid                               maViewContactOfGridFront;
     263                 :            :             ViewContactOfHelplines                          maViewContactOfHelplinesFront;
     264                 :            : 
     265                 :            :             // Create a Object-Specific ViewObjectContact, set ViewContact and
     266                 :            :             // ObjectContact. Always needs to return something. Default is to create
     267                 :            :             // a standard ViewObjectContact containing the given ObjectContact and *this
     268                 :            :             virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
     269                 :            : 
     270                 :            :         public:
     271                 :            :             // access to SdrObject
     272                 :     230270 :             SdrPage& GetSdrPage() const
     273                 :            :             {
     274                 :     230270 :                 return mrPage;
     275                 :            :             }
     276                 :            : 
     277                 :            :             // basic constructor, used from SdrPage.
     278                 :            :             explicit ViewContactOfSdrPage(SdrPage& rObj);
     279                 :            :             virtual ~ViewContactOfSdrPage();
     280                 :            : 
     281                 :            :             // Access to possible sub-hierarchy
     282                 :            :             virtual sal_uInt32 GetObjectCount() const;
     283                 :            :             virtual ViewContact& GetViewContact(sal_uInt32 nIndex) const;
     284                 :            : 
     285                 :            :             // React on changes of the object of this ViewContact
     286                 :            :             virtual void ActionChanged();
     287                 :            : 
     288                 :            :             // overload for acessing the SdrPage
     289                 :            :             virtual SdrPage* TryToGetSdrPage() const;
     290                 :            : 
     291                 :            :         protected:
     292                 :            :             // This method is responsible for creating the graphical visualisation data
     293                 :            :             // ONLY based on model data
     294                 :            :             virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
     295                 :            :         };
     296                 :            :     } // end of namespace contact
     297                 :            : } // end of namespace sdr
     298                 :            : 
     299                 :            : //////////////////////////////////////////////////////////////////////////////
     300                 :            : 
     301                 :            : #endif //_SDR_CONTACT_VIEWCONTACTOFSDRPAGE_HXX
     302                 :            : 
     303                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10