LCOV - code coverage report
Current view: top level - libreoffice/solver/unxlngi6.pro/inc/svtools - imap.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 6 0.0 %
Date: 2012-12-17 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 _IMAP_HXX
      21             : #define _IMAP_HXX
      22             : 
      23             : #include "svtools/svtdllapi.h"
      24             : #include <tools/string.hxx>
      25             : #include <tools/stream.hxx>
      26             : #include <vector>
      27             : 
      28             : class Point;
      29             : class Rectangle;
      30             : class Size;
      31             : class Fraction;
      32             : class IMapObject;
      33             : 
      34             : typedef ::std::vector< IMapObject* > IMapObjectList_impl;
      35             : 
      36             : class SVT_DLLPUBLIC ImageMap
      37             : {
      38             : private:
      39             : 
      40             :     IMapObjectList_impl maList;
      41             :     String              aName;
      42             : 
      43             : protected:
      44             : 
      45             :     // Binaer laden/speichern
      46             :     void                ImpWriteImageMap( SvStream& rOStm, const String& ) const ;
      47             :     void                ImpReadImageMap( SvStream& rIStm, size_t nCount, const String& );
      48             : 
      49             :     // Im-/Export
      50             :     void                ImpWriteCERN( SvStream& rOStm, const String& rBaseURL ) const;
      51             :     void                ImpWriteNCSA( SvStream& rOStm, const String& rBaseURL ) const;
      52             :     sal_uLong           ImpReadCERN( SvStream& rOStm, const String& rBaseURL );
      53             :     sal_uLong           ImpReadNCSA( SvStream& rOStm, const String& rBaseURL );
      54             : 
      55             :     void                ImpReadCERNLine( const rtl::OString& rLine, const String& rBaseURL );
      56             :     Point               ImpReadCERNCoords( const char** ppStr );
      57             :     long                ImpReadCERNRadius( const char** ppStr );
      58             :     String              ImpReadCERNURL( const char** ppStr, const String& rBaseURL );
      59             : 
      60             :     void                ImpReadNCSALine( const rtl::OString& rLine, const String& rBaseURL );
      61             :     String              ImpReadNCSAURL( const char** ppStr, const String& rBaseURL );
      62             :     Point               ImpReadNCSACoords( const char** ppStr );
      63             : 
      64             :     sal_uLong           ImpDetectFormat( SvStream& rIStm );
      65             : 
      66             : public:
      67             : 
      68             :     TYPEINFO();
      69             : 
      70           0 :                         ImageMap() {};
      71             :                         ImageMap( const String& rName );
      72             :                         ImageMap( const ImageMap& rImageMap );
      73             : 
      74             :                         // Der Dtor gibt den intern belegten
      75             :                         // Speicher wieder frei;
      76             :                         //  alle IMapObjekte werden im Dtor zerstoert;
      77             :     virtual             ~ImageMap();
      78             : 
      79             :     // Zuweisungsoperator
      80             :     ImageMap&           operator=( const ImageMap& rImageMap );
      81             : 
      82             :     // Vergleichsoperator (es wird alles auf Gleichheit geprueft)
      83             :     sal_Bool                operator==( const ImageMap& rImageMap );
      84             :     sal_Bool                operator!=( const ImageMap& rImageMap );
      85             : 
      86             :     // In die Map wird ein neues IMap-Obkekt ans Ende eingefuegt
      87             :     void                InsertIMapObject( const IMapObject& rIMapObject );
      88             : 
      89             :     // Zugriff auf einzelne IMapObjekte; die Objekte
      90             :     // duerfen von aussen _nicht_ zerstoert werden
      91           0 :     IMapObject*         GetIMapObject( size_t nPos ) const
      92             :                         {
      93           0 :                             return ( nPos < maList.size() ) ? maList[ nPos ] : NULL;
      94             :                         }
      95             : 
      96             :     // Gibt das Objekt zurueck, das zuerst getroffen wurde oder NULL;
      97             :     // Groessen- und Positionsangaben sind in 1/100mm;
      98             :     // rTotalSize ist die Originalgroesse des Bildes;
      99             :     // rDisplaySize die aktuelle Darstellungsgroesse;
     100             :     // rRelPoint bezieht sich auf die Darstellungsgroesse
     101             :     // und die linke oebere Ecke des Bildes
     102             :     IMapObject*         GetHitIMapObject( const Size& rOriginalSize,
     103             :                                           const Size& rDisplaySize,
     104             :                                           const Point& rRelHitPoint,
     105             :                                           sal_uLong nFlags = 0 );
     106             : 
     107             :     // Gibt die Gesamtanzahl der IMap-Objekte zurueck
     108           0 :     size_t              GetIMapObjectCount() const { return maList.size(); }
     109             : 
     110             :     // Loescht alle internen Objekte
     111             :     void                ClearImageMap();
     112             : 
     113             :     // liefert die aktuelle Versionsnummer
     114             :     sal_uInt16          GetVersion() const;
     115             : 
     116             :     // liefert / setzt den Namen der ImageMap
     117           0 :     const String&       GetName() const { return aName; }
     118           0 :     void                SetName( const String& rName ) { aName = rName; }
     119             : 
     120             :     // skaliert alle Objekte der ImageMap entpr. dem uebergebenen Faktor
     121             :     void                Scale( const Fraction& rFractX, const Fraction& rFracY );
     122             : 
     123             :     // Im-/Export
     124             :     void                Write ( SvStream& rOStm, const String& rBaseURL ) const;
     125             :     void                Read( SvStream& rIStm, const String& rBaseURL );
     126             : 
     127             :     void                Write( SvStream& rOStm, sal_uLong nFormat, const String& rBaseURL ) const;
     128             :     sal_uLong               Read( SvStream& rIStm, sal_uLong nFormat, const String& rBaseURL );
     129             : };
     130             : 
     131             : class IMapCompat
     132             : {
     133             :     SvStream*       pRWStm;
     134             :     sal_uLong           nCompatPos;
     135             :     sal_uLong           nTotalSize;
     136             :     sal_uInt16          nStmMode;
     137             : 
     138             :                     IMapCompat() {}
     139             :                     IMapCompat( const IMapCompat& ) {}
     140             :     IMapCompat&     operator=( const IMapCompat& ) { return *this; }
     141             :     sal_Bool            operator==( const IMapCompat& ) { return sal_False; }
     142             : 
     143             : public:
     144             : 
     145             :                     IMapCompat( SvStream& rStm, const sal_uInt16 nStreamMode );
     146             :                     ~IMapCompat();
     147             : };
     148             : 
     149             : #endif // _IMAP_HXX
     150             : 
     151             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10