Gtk-WARNING gtktreestore.c:1047: Invalid column number 1 added to iter
[LibreOffice.git] / include / svtools / place.hxx
blobbdb6da2f3843d33898b8a8de14caa9da5734ec3b
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/.
8 */
10 #pragma once
12 #include <tools/urlobj.hxx>
13 #include <utility>
15 class Place
17 private:
18 OUString msName;
19 INetURLObject maUrl;
21 bool mbEditable;
23 public:
25 Place( OUString sName, std::u16string_view sUrl, bool bEditable = false ) :
26 msName(std::move( sName )),
27 maUrl( sUrl ),
28 mbEditable( bEditable ) {};
30 void SetName(const OUString& aName ) { msName = aName; }
31 void SetUrl(std::u16string_view aUrl ) { maUrl.SetURL( aUrl ); }
33 OUString& GetName( ) { return msName; }
34 OUString GetUrl( ) const { return maUrl.GetMainURL( INetURLObject::DecodeMechanism::NONE ); }
35 INetURLObject& GetUrlObject( ) { return maUrl; }
36 bool IsLocal( ) const { return maUrl.GetProtocol() == INetProtocol::File; }
37 bool IsEditable( ) const { return mbEditable; }
40 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */