Debian Codegraph @

shell/source/win32/shlxthandler/propsheets/listviewbuilder.hxx

raw
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 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20 #ifndef INCLUDED_SHELL_SOURCE_WIN32_SHLXTHANDLER_PROPSHEETS_LISTVIEWBUILDER_HXX
21 #define INCLUDED_SHELL_SOURCE_WIN32_SHLXTHANDLER_PROPSHEETS_LISTVIEWBUILDER_HXX
22
23 #if !defined WIN32_LEAN_AND_MEAN
24 # define WIN32_LEAN_AND_MEAN
25 #endif
26 #include <windows.h>
27
28 #include <string>
29 #include <memory>
30 #include "document_statistic.hxx"
31
32
33 class list_view_builder;
34 typedef std::unique_ptr<list_view_builder> list_view_builder_ptr;
35
36 // factory method for list_view_builder
37 list_view_builder_ptr create_list_view_builder(
38 HWND hwnd_lv, const std::wstring& col1, const std::wstring& col2);
39
40
41 class list_view_builder
42 {
43 public:
44 virtual ~list_view_builder();
45
46 void build(statistic_group_list_t& gl);
47
48 protected:
49 list_view_builder(
50 HWND hwnd_list_view,
51 const std::wstring& column1_title,
52 const std::wstring& column2_title);
53
54 virtual void setup_list_view();
55 virtual void insert_group(const std::wstring& title);
56 virtual void insert_item(const std::wstring& title, const std::wstring& value, bool is_editable);
57
58 HWND get_list_view() const;
59 private:
60 int row_index_;
61 HWND hwnd_list_view_;
62 std::wstring column1_title_;
63 std::wstring column2_title_;
64 int group_count_;
65 int row_count_;
66
67 friend list_view_builder_ptr create_list_view_builder(HWND hwnd_lv, const std::wstring& col1, const std::wstring& col2);
68 };
69
70 #endif
71
72 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */