new loplugin:noexceptmove
[LibreOffice.git] / include / tools / globname.hxx
blob9672f444ccadf29fcac8097850e313184b336e21
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_TOOLS_GLOBNAME_HXX
20 #define INCLUDED_TOOLS_GLOBNAME_HXX
22 #include <tools/toolsdllapi.h>
23 #include <com/sun/star/uno/Sequence.hxx>
24 #include <o3tl/cow_wrapper.hxx>
26 struct SAL_WARN_UNUSED SvGUID
28 sal_uInt32 Data1;
29 sal_uInt16 Data2;
30 sal_uInt16 Data3;
31 sal_uInt8 Data4[8];
34 struct SAL_WARN_UNUSED ImpSvGlobalName
36 struct SvGUID szData;
38 ImpSvGlobalName(const SvGUID &rData)
39 : szData(rData)
42 ImpSvGlobalName(sal_uInt32 n1, sal_uInt16 n2, sal_uInt16 n3,
43 sal_uInt8 b8, sal_uInt8 b9, sal_uInt8 b10, sal_uInt8 b11,
44 sal_uInt8 b12, sal_uInt8 b13, sal_uInt8 b14, sal_uInt8 b15);
45 ImpSvGlobalName( const ImpSvGlobalName & rObj );
46 ImpSvGlobalName();
48 bool operator == ( const ImpSvGlobalName & rObj ) const;
51 class SvStream;
53 class SAL_WARN_UNUSED TOOLS_DLLPUBLIC SvGlobalName
55 ::o3tl::cow_wrapper< ImpSvGlobalName > pImp;
57 public:
58 SvGlobalName();
59 SvGlobalName( const SvGlobalName & rObj ) :
60 pImp( rObj.pImp )
63 SvGlobalName( SvGlobalName && rObj ) noexcept :
64 pImp( std::move(rObj.pImp) )
68 SvGlobalName( sal_uInt32 n1, sal_uInt16 n2, sal_uInt16 n3,
69 sal_uInt8 b8, sal_uInt8 b9, sal_uInt8 b10, sal_uInt8 b11,
70 sal_uInt8 b12, sal_uInt8 b13, sal_uInt8 b14, sal_uInt8 b15 );
72 // create SvGlobalName from a platform independent representation
73 SvGlobalName( const css::uno::Sequence< sal_Int8 >& aSeq );
75 SvGlobalName( const SvGUID & rId );
77 SvGlobalName & operator = ( const SvGlobalName & rObj );
78 SvGlobalName & operator = ( SvGlobalName && rObj ) noexcept;
79 ~SvGlobalName();
81 TOOLS_DLLPUBLIC friend SvStream & operator >> ( SvStream &, SvGlobalName & );
82 TOOLS_DLLPUBLIC friend SvStream & WriteSvGlobalName( SvStream &, const SvGlobalName & );
84 bool operator < ( const SvGlobalName & rObj ) const;
86 bool operator == ( const SvGlobalName & rObj ) const;
87 bool operator != ( const SvGlobalName & rObj ) const
88 { return !(*this == rObj); }
90 void MakeFromMemory( void const * pData );
91 bool MakeId( const OUString & rId );
92 OUString GetHexName() const;
94 const SvGUID& GetCLSID() const { return pImp->szData; }
96 // platform independent representation of a "GlobalName"
97 // maybe transported remotely
98 css::uno::Sequence < sal_Int8 > GetByteSequence() const;
101 #endif
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */