Bump version to 5.0-14
[LibreOffice.git] / shell / source / win32 / shlxthandler / propsheets / listviewbuilder.hxx
blob870c33c1dd87e32a392510cb9740108086f2e392
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 .
20 #ifndef INCLUDED_SHELL_SOURCE_WIN32_SHLXTHANDLER_PROPSHEETS_LISTVIEWBUILDER_HXX
21 #define INCLUDED_SHELL_SOURCE_WIN32_SHLXTHANDLER_PROPSHEETS_LISTVIEWBUILDER_HXX
23 #if defined _MSC_VER
24 #pragma warning(push, 1)
25 #endif
26 #include <windows.h>
27 #if defined _MSC_VER
28 #pragma warning(pop)
29 #endif
31 #include <string>
32 #include <memory>
33 #include "document_statistic.hxx"
37 class list_view_builder;
38 typedef std::unique_ptr<list_view_builder> list_view_builder_ptr;
40 // factory method for list_view_builder
41 list_view_builder_ptr create_list_view_builder(
42 HWND hwnd_lv, const std::wstring& col1, const std::wstring& col2);
46 class list_view_builder
48 public:
49 virtual ~list_view_builder();
51 void build(statistic_group_list_t& gl);
53 protected:
54 list_view_builder(
55 HWND hwnd_list_view,
56 const std::wstring& column1_title,
57 const std::wstring& column2_title);
59 virtual void setup_list_view();
60 virtual void insert_group(const std::wstring& title);
61 virtual void insert_item(const std::wstring& title, const std::wstring& value, bool is_editable);
63 HWND get_list_view() const;
64 int get_current_row() const;
66 int row_index_;
68 private:
69 HWND hwnd_list_view_;
70 std::wstring column1_title_;
71 std::wstring column2_title_;
73 friend list_view_builder_ptr create_list_view_builder(HWND hwnd_lv, const std::wstring& col1, const std::wstring& col2);
78 class winxp_list_view_builder : public list_view_builder
80 protected:
81 winxp_list_view_builder(
82 HWND hwnd_list_view,
83 const std::wstring& column1_title,
84 const std::wstring& column2_title);
86 virtual void setup_list_view();
87 virtual void insert_group(const std::wstring& name);
88 virtual void insert_item(const std::wstring& title, const std::wstring& value, bool is_editable);
90 private:
91 int group_count_;
92 int row_count_;
94 friend list_view_builder_ptr create_list_view_builder(HWND hwnd_lv, const std::wstring& col1, const std::wstring& col2);
97 #endif
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */