Bump version to 5.0-14
[LibreOffice.git] / svtools / source / table / mousefunction.hxx
blob6256259e6bd6471500084b07ddec826298113e59
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_SVTOOLS_SOURCE_TABLE_MOUSEFUNCTION_HXX
21 #define INCLUDED_SVTOOLS_SOURCE_TABLE_MOUSEFUNCTION_HXX
23 #include <svtools/table/tabletypes.hxx>
25 #include <rtl/ref.hxx>
26 #include <salhelper/simplereferenceobject.hxx>
28 #include <boost/noncopyable.hpp>
30 class MouseEvent;
33 namespace svt { namespace table
37 class ITableControl;
40 //= FunctionResult
42 enum FunctionResult
44 ActivateFunction,
45 ContinueFunction,
46 DeactivateFunction,
48 SkipFunction
52 //= MouseFunction
54 class MouseFunction : public ::salhelper::SimpleReferenceObject, public ::boost::noncopyable
56 public:
57 MouseFunction() {}
58 virtual FunctionResult handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event ) = 0;
59 virtual FunctionResult handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event ) = 0;
60 virtual FunctionResult handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event ) = 0;
62 protected:
63 virtual ~MouseFunction() { }
67 //= ColumnResize
69 class ColumnResize : public MouseFunction
71 public:
72 ColumnResize()
73 :m_nResizingColumn( COL_INVALID )
77 public:
78 // MouseFunction
79 virtual FunctionResult handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event ) SAL_OVERRIDE;
80 virtual FunctionResult handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event ) SAL_OVERRIDE;
81 virtual FunctionResult handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event ) SAL_OVERRIDE;
83 private:
84 ColPos m_nResizingColumn;
88 //= RowSelection
90 class RowSelection : public MouseFunction
92 public:
93 RowSelection()
94 :m_bActive( false )
98 public:
99 // MouseFunction
100 virtual FunctionResult handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event ) SAL_OVERRIDE;
101 virtual FunctionResult handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event ) SAL_OVERRIDE;
102 virtual FunctionResult handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event ) SAL_OVERRIDE;
104 private:
105 bool m_bActive;
109 //= ColumnSortHandler
111 class ColumnSortHandler : public MouseFunction
113 public:
114 ColumnSortHandler()
115 :m_nActiveColumn( COL_INVALID )
119 public:
120 // MouseFunction
121 virtual FunctionResult handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event ) SAL_OVERRIDE;
122 virtual FunctionResult handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event ) SAL_OVERRIDE;
123 virtual FunctionResult handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event ) SAL_OVERRIDE;
125 private:
126 ColPos m_nActiveColumn;
130 } } // namespace svt::table
133 #endif // INCLUDED_SVTOOLS_SOURCE_TABLE_MOUSEFUNCTION_HXX
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */