1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
12 #include <vcl/weld.hxx>
19 class SfxDocumentTemplates
;
20 class TemplateContainerItem
;
26 ListView(std::unique_ptr
<weld::TreeView
> xTreeView
);
29 void AppendItem(const OUString
& rId
, const OUString
& rTitle
, const OUString
& rSubtitle
,
30 const OUString
& rPath
, bool bDefault
);
32 void AppendRow(const OUString
& rImage
, const OUString
& rTitle
, const OUString
& rSubtitle
,
33 const OUString
& rApplication
, const OUString
& rModify
, const OUString
& rSize
,
36 void UpdateRow(int nIndex
, const OUString
& rImage
, const OUString
& rTitle
,
37 const OUString
& rSubtitle
, const OUString
& rApplication
, const OUString
& rModify
,
38 const OUString
& rSize
, const OUString
& rId
);
44 void sortColumn(const int col
);
50 void ShowListView() { mxTreeView
->show(); }
52 void HideListView() { mxTreeView
->hide(); }
54 void unselect_all() { mxTreeView
->unselect_all(); }
56 void grab_focus() { mxTreeView
->grab_focus(); }
58 void rename(const OUString
& rId
, const OUString
& rTitle
);
60 void refreshDefaultColumn();
63 sal_uInt16
get_nId(int pos
) const;
65 void select_id(const OUString
& sId
) { mxTreeView
->select_id(sId
); }
67 int get_selected_index() const { return mxTreeView
->get_selected_index(); }
69 std::vector
<int> get_selected_rows() const { return mxTreeView
->get_selected_rows(); }
71 bool IsListViewVisible() const { return mxTreeView
->is_visible(); }
73 OUString
get_id(int pos
) const { return mxTreeView
->get_id(pos
); }
75 void set_cursor(int pos
) { mxTreeView
->set_cursor(pos
); }
77 int get_cursor_index() const { return mxTreeView
->get_cursor_index(); }
79 sal_uInt16
get_cursor_nId() const { return get_nId(mxTreeView
->get_cursor_index()); }
81 void select(int pos
) { mxTreeView
->select(pos
); }
83 int get_index(sal_uInt16 nId
) const { return mxTreeView
->find_id(OUString::number(nId
)); }
85 DECL_LINK(ColumnClickedHdl
, const int, void);
87 DECL_LINK(QueryTooltipHdl
, const weld::TreeIter
&, OUString
);
90 std::unique_ptr
<weld::TreeView
> mxTreeView
;
91 std::vector
<std::unique_ptr
<ListViewItem
>> mListViewItems
;
101 OUString maApplication
;
105 /** Last modify time in seconds since 1/1/1970. */
107 /** Size in bytes of the file. */
110 OUString maDisplayModify
;
111 OUString maDisplaySize
;
112 OUString maDisplayPath
;
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */