Impress Remote 1.0.5, tag sdremote-1.0.5
[LibreOffice.git] / sc / inc / typedstrdata.hxx
blob15098451e1250a94bdc6af8d56e0f305c9983172
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * Version: MPL 1.1 / GPLv3+ / LGPLv3+
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License or as specified alternatively below. You may obtain a copy of
8 * the License at http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * Major Contributor(s):
16 * Copyright (C) 2012 Kohei Yoshida <kohei.yoshida@suse.com>
18 * All Rights Reserved.
20 * For minor contributions see the git repository.
22 * Alternatively, the contents of this file may be used under the terms of
23 * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
24 * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
25 * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
26 * instead of those above.
29 #ifndef __SC_TYPEDSTRDATA_HXX__
30 #define __SC_TYPEDSTRDATA_HXX__
32 #include "rtl/ustring.hxx"
33 #include "scdllapi.h"
35 #include <set>
37 class ScTypedStrData
39 public:
40 enum StringType {
41 Value = 0,
42 Standard = 1,
43 Name = 2,
44 DbName = 3,
45 Header = 4
48 ScTypedStrData( const rtl::OUString& rStr, double nVal = 0.0,
49 StringType eType = Standard );
51 ScTypedStrData( const ScTypedStrData& rCpy );
53 bool IsStrData() const;
54 SC_DLLPUBLIC const rtl::OUString& GetString() const;
55 StringType GetStringType() const;
57 struct LessCaseSensitive : std::binary_function<ScTypedStrData, ScTypedStrData, bool>
59 bool operator() (const ScTypedStrData& left, const ScTypedStrData& right) const;
62 struct LessCaseInsensitive : std::binary_function<ScTypedStrData, ScTypedStrData, bool>
64 bool operator() (const ScTypedStrData& left, const ScTypedStrData& right) const;
67 struct EqualCaseSensitive : std::binary_function<ScTypedStrData, ScTypedStrData, bool>
69 bool operator() (const ScTypedStrData& left, const ScTypedStrData& right) const;
72 struct EqualCaseInsensitive : std::binary_function<ScTypedStrData, ScTypedStrData, bool>
74 bool operator() (const ScTypedStrData& left, const ScTypedStrData& right) const;
77 bool operator== (const ScTypedStrData& r) const;
78 bool operator< (const ScTypedStrData& r) const;
80 private:
81 rtl::OUString maStrValue;
82 double mfValue;
83 StringType meStrType;
86 class FindTypedStrData : std::unary_function<ScTypedStrData, bool>
88 ScTypedStrData maVal;
89 bool mbCaseSens;
90 public:
91 FindTypedStrData(const ScTypedStrData& rVal, bool bCaseSens);
92 bool operator() (const ScTypedStrData& r) const;
95 typedef std::set<ScTypedStrData, ScTypedStrData::LessCaseSensitive> ScTypedCaseStrSet;
97 #endif
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */