1 /* 2 * Copyright (c) 2020-2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 /** 17 * @addtogroup UI_Events 18 * @{ 19 * 20 * @brief Defines UI events, such as press, click and drag events. 21 * 22 * @since 1.0 23 * @version 1.0 24 */ 25 26 /** 27 * @file long_press_event.h 28 * 29 * @brief Declares a long-press event, which indicates that the finger is not raised or moved within 1 second 30 * after a view is pressed. 31 * 32 * @since 1.0 33 * @version 1.0 34 */ 35 36 #ifndef GRAPHIC_LITE_LONG_PRESS_EVENT_H 37 #define GRAPHIC_LITE_LONG_PRESS_EVENT_H 38 39 #include "event.h" 40 41 namespace OHOS { 42 /** 43 * @brief Defines a long-press event, which indicates that the finger is not raised or moved within 1 second 44 * after a view is pressed. 45 * 46 * @since 1.0 47 * @version 1.0 48 */ 49 class LongPressEvent : public Event { 50 public: 51 /** 52 * @brief A constructor used to create a <b>LongPressEvent</b> instance. 53 * @param pos Indicates the position where the long-press event occurs. 54 * @param timeStamp Indicates the time stamp when the long-press event occurs. 55 * @since 1.0 56 * @version 1.0 57 */ LongPressEvent(const Point & pos,const TimeType & timeStamp)58 LongPressEvent(const Point& pos, const TimeType& timeStamp) : Event(pos) 59 { 60 timeStamp_ = timeStamp; 61 } 62 63 /** 64 * @brief A destructor used to delete the <b>LongPressEvent</b> instance. 65 * @since 1.0 66 * @version 1.0 67 */ ~LongPressEvent()68 virtual ~LongPressEvent() {} 69 }; 70 } // namespace OHOS 71 #endif // GRAPHIC_LITE_LONG_PRESS_EVENT_H 72