LCOV - code coverage report
Current view: top level - dbaccess/source/ui/inc - charsets.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 0 6 0.0 %
Date: 2015-06-13 12:38:46 Functions: 0 7 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 INCLUDED_DBACCESS_SOURCE_UI_INC_CHARSETS_HXX
      21             : #define INCLUDED_DBACCESS_SOURCE_UI_INC_CHARSETS_HXX
      22             : 
      23             : #include <connectivity/dbcharset.hxx>
      24             : #include <rtl/ustring.hxx>
      25             : #include <svx/txenctab.hxx>
      26             : 
      27             : namespace dbaui
      28             : {
      29             : 
      30             :     // OCharsetDisplay
      31             :     typedef ::dbtools::OCharsetMap OCharsetDisplay_Base;
      32           0 :     class OCharsetDisplay
      33             :             :protected OCharsetDisplay_Base
      34             :             ,protected SvxTextEncodingTable
      35             :     {
      36             :     protected:
      37             :         OUString m_aSystemDisplayName;
      38             : 
      39             :     public:
      40             :         class ExtendedCharsetIterator;
      41             :         friend class OCharsetDisplay::ExtendedCharsetIterator;
      42             : 
      43             :         typedef ExtendedCharsetIterator iterator;
      44             :         typedef ExtendedCharsetIterator const_iterator;
      45             : 
      46             :         OCharsetDisplay();
      47             : 
      48             :         // various find operations
      49             :         const_iterator findEncoding(const rtl_TextEncoding _eEncoding) const;
      50             :         const_iterator findIanaName(const OUString& _rIanaName) const;
      51             :         const_iterator findDisplayName(const OUString& _rDisplayName) const;
      52             : 
      53             :         /// get access to the first element of the charset collection
      54             :         const_iterator  begin() const;
      55             :         /// get access to the (last + 1st) element of the charset collection
      56             :         const_iterator  end() const;
      57             :         // size of the map
      58             :         sal_Int32   size() const { return OCharsetDisplay_Base::size(); }
      59             : 
      60             :     protected:
      61             :         virtual bool approveEncoding( const rtl_TextEncoding _eEncoding, const rtl_TextEncodingInfo& _rInfo ) const SAL_OVERRIDE;
      62             : 
      63             :     private:
      64             :         using OCharsetDisplay_Base::find;
      65             :     };
      66             : 
      67             :     //- CharsetDisplayDerefHelper
      68             :     typedef ::dbtools::CharsetIteratorDerefHelper CharsetDisplayDerefHelper_Base;
      69           0 :     class CharsetDisplayDerefHelper : protected CharsetDisplayDerefHelper_Base
      70             :     {
      71             :         friend class OCharsetDisplay::ExtendedCharsetIterator;
      72             : 
      73             :         OUString                         m_sDisplayName;
      74             : 
      75             :     public:
      76             :         CharsetDisplayDerefHelper(const CharsetDisplayDerefHelper& _rSource);
      77             : 
      78             :         rtl_TextEncoding    getEncoding() const         { return CharsetDisplayDerefHelper_Base::getEncoding(); }
      79           0 :         OUString     getIanaName() const         { return CharsetDisplayDerefHelper_Base::getIanaName(); }
      80           0 :         OUString     getDisplayName() const      { return m_sDisplayName; }
      81             : 
      82             :     protected:
      83             :         CharsetDisplayDerefHelper(const ::dbtools::CharsetIteratorDerefHelper& _rBase, const OUString& _rDisplayName);
      84             :     };
      85             : 
      86             :     //- OCharsetDisplay::ExtendedCharsetIterator
      87           0 :     class OCharsetDisplay::ExtendedCharsetIterator
      88             :     {
      89             :         friend class OCharsetDisplay;
      90             : 
      91             :         friend bool operator==(const ExtendedCharsetIterator& lhs, const ExtendedCharsetIterator& rhs);
      92           0 :         friend bool operator!=(const ExtendedCharsetIterator& lhs, const ExtendedCharsetIterator& rhs) { return !(lhs == rhs); }
      93             : 
      94             :         typedef ::dbtools::OCharsetMap      container;
      95             :         typedef container::CharsetIterator  base_iterator;
      96             : 
      97             :     protected:
      98             :         const OCharsetDisplay*      m_pContainer;
      99             :         base_iterator               m_aPosition;
     100             : 
     101             :     public:
     102             :         ExtendedCharsetIterator(const ExtendedCharsetIterator& _rSource);
     103             : 
     104             :         CharsetDisplayDerefHelper operator*() const;
     105             : 
     106             :         /// prefix increment
     107             :         const ExtendedCharsetIterator&  operator++();
     108             :         /// postfix increment
     109             :         const ExtendedCharsetIterator   operator++(int) { ExtendedCharsetIterator hold(*this); ++*this; return hold; }
     110             : 
     111             :         /// prefix decrement
     112             :         const ExtendedCharsetIterator&  operator--();
     113             :         /// postfix decrement
     114             :         const ExtendedCharsetIterator   operator--(int) { ExtendedCharsetIterator hold(*this); --*this; return hold; }
     115             : 
     116             :     protected:
     117             :         ExtendedCharsetIterator( const OCharsetDisplay* _pContainer, const base_iterator& _rPosition );
     118             :     };
     119             : 
     120             : }   // namespace dbaui
     121             : 
     122             : #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_CHARSETS_HXX
     123             : 
     124             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11