update dev300-m57
[ooovba.git] / sc / inc / userlist.hxx
blob1d966fda51ac2108d88754f99c4556b3cf258862
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: userlist.hxx,v $
10 * $Revision: 1.5.32.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_USERLIST_HXX
32 #define SC_USERLIST_HXX
34 #include <tools/stream.hxx>
35 #include "scdllapi.h"
36 #include "collect.hxx"
38 //------------------------------------------------------------------------
39 class SC_DLLPUBLIC ScUserListData : public ScDataObject
41 friend class ScUserList;
42 String aStr;
43 USHORT nTokenCount;
44 String* pSubStrings;
45 String* pUpperSub;
47 SC_DLLPRIVATE void InitTokens();
49 public:
50 ScUserListData(const String& rStr);
51 ScUserListData(const ScUserListData& rData);
52 virtual ~ScUserListData();
54 virtual ScDataObject* Clone() const { return new ScUserListData(*this); }
56 const String& GetString() const { return aStr; }
57 void SetString( const String& rStr);
58 USHORT GetSubCount() const;
59 BOOL GetSubIndex(const String& rSubStr, USHORT& rIndex) const;
60 String GetSubStr(USHORT nIndex) const;
61 StringCompare Compare(const String& rSubStr1, const String& rSubStr2) const;
62 StringCompare ICompare(const String& rSubStr1, const String& rSubStr2) const;
65 //------------------------------------------------------------------------
66 class SC_DLLPUBLIC ScUserList : public ScCollection
68 public:
69 ScUserList( USHORT nLim = 4, USHORT nDel = 4);
70 ScUserList( const ScUserList& rUserList ) : ScCollection ( rUserList ) {}
72 virtual ScDataObject* Clone() const;
74 ScUserListData* GetData( const String& rSubStr ) const;
75 /// If the list in rStr is already inserted
76 BOOL HasEntry( const String& rStr ) const;
78 inline ScUserListData* operator[]( const USHORT nIndex) const;
79 inline ScUserList& operator= ( const ScUserList& r );
80 BOOL operator==( const ScUserList& r ) const;
81 inline BOOL operator!=( const ScUserList& r ) const;
84 inline ScUserList& ScUserList::operator=( const ScUserList& r )
85 { return (ScUserList&)ScCollection::operator=( r ); }
87 inline ScUserListData* ScUserList::operator[]( const USHORT nIndex) const
88 { return (ScUserListData*)At(nIndex); }
90 inline BOOL ScUserList::operator!=( const ScUserList& r ) const
91 { return !operator==( r ); }
93 #endif