GPU-Calc: remove Alloc_Host_Ptr for clmem of NAN vector
[LibreOffice.git] / svtools / source / table / mousefunction.hxx
blob8f2ffe81f669f3cd72dd0c49b59bb5bd71b6c912
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>
27 #include <boost/noncopyable.hpp>
29 class MouseEvent;
31 //......................................................................................................................
32 namespace svt { namespace table
34 //......................................................................................................................
36 class ITableControl;
38 //==================================================================================================================
39 //= FunctionResult
40 //==================================================================================================================
41 enum FunctionResult
43 ActivateFunction,
44 ContinueFunction,
45 DeactivateFunction,
47 SkipFunction
50 //==================================================================================================================
51 //= IMouseFunction
52 //==================================================================================================================
53 class IMouseFunction : public ::rtl::IReference, public ::boost::noncopyable
55 public:
56 virtual FunctionResult handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event ) = 0;
57 virtual FunctionResult handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event ) = 0;
58 virtual FunctionResult handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event ) = 0;
60 protected:
61 virtual ~IMouseFunction() { }
64 //==================================================================================================================
65 //= MouseFunction
66 //==================================================================================================================
67 class MouseFunction : public IMouseFunction
69 public:
70 MouseFunction()
71 :m_refCount( 0 )
74 protected:
75 ~MouseFunction()
79 public:
80 virtual oslInterlockedCount SAL_CALL acquire();
81 virtual oslInterlockedCount SAL_CALL release();
83 private:
84 oslInterlockedCount m_refCount;
87 //==================================================================================================================
88 //= ColumnResize
89 //==================================================================================================================
90 class ColumnResize : public MouseFunction
92 public:
93 ColumnResize()
94 :m_nResizingColumn( COL_INVALID )
98 public:
99 // IMouseFunction
100 virtual FunctionResult handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event );
101 virtual FunctionResult handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event );
102 virtual FunctionResult handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event );
104 private:
105 ColPos m_nResizingColumn;
108 //==================================================================================================================
109 //= RowSelection
110 //==================================================================================================================
111 class RowSelection : public MouseFunction
113 public:
114 RowSelection()
115 :m_bActive( false )
119 public:
120 // IMouseFunction
121 virtual FunctionResult handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event );
122 virtual FunctionResult handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event );
123 virtual FunctionResult handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event );
125 private:
126 bool m_bActive;
129 //==================================================================================================================
130 //= ColumnSortHandler
131 //==================================================================================================================
132 class ColumnSortHandler : public MouseFunction
134 public:
135 ColumnSortHandler()
136 :m_nActiveColumn( COL_INVALID )
140 public:
141 // IMouseFunction
142 virtual FunctionResult handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event );
143 virtual FunctionResult handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event );
144 virtual FunctionResult handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event );
146 private:
147 ColPos m_nActiveColumn;
150 //......................................................................................................................
151 } } // namespace svt::table
152 //......................................................................................................................
154 #endif // INCLUDED_SVTOOLS_SOURCE_TABLE_MOUSEFUNCTION_HXX
156 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */