LibreOffice Module svtools (master) 1
place.hxx
Go to the documentation of this file.
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
10#pragma once
11
12#include <tools/urlobj.hxx>
13#include <utility>
14
15class Place
16{
17private:
18 OUString msName;
20
22
23public:
24
25 Place( OUString sName, std::u16string_view sUrl, bool bEditable = false ) :
26 msName(std::move( sName )),
27 maUrl( sUrl ),
28 mbEditable( bEditable ) {};
29
30 void SetName(const OUString& aName ) { msName = aName; }
31 void SetUrl(std::u16string_view aUrl ) { maUrl.SetURL( aUrl ); }
32
33 OUString& GetName( ) { return msName; }
36 bool IsLocal( ) const { return maUrl.GetProtocol() == INetProtocol::File; }
37 bool IsEditable( ) const { return mbEditable; }
38};
39
40/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
INetProtocol GetProtocol() const
bool SetURL(std::u16string_view rTheAbsURIRef, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
Definition: place.hxx:16
void SetUrl(std::u16string_view aUrl)
Definition: place.hxx:31
Place(OUString sName, std::u16string_view sUrl, bool bEditable=false)
Definition: place.hxx:25
void SetName(const OUString &aName)
Definition: place.hxx:30
OUString msName
Definition: place.hxx:18
OUString & GetName()
Definition: place.hxx:33
INetURLObject & GetUrlObject()
Definition: place.hxx:35
bool IsLocal() const
Definition: place.hxx:36
INetURLObject maUrl
Definition: place.hxx:19
bool mbEditable
Definition: place.hxx:21
bool IsEditable() const
Definition: place.hxx:37
OUString GetUrl() const
Definition: place.hxx:34
OUString sName
OUString aName