Line data Source code
1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 : /* This Source Code Form is subject to the terms of the Mozilla Public
4 : * License, v. 2.0. If a copy of the MPL was not distributed with this
5 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 :
7 : #ifndef ButtonInputTypes_h__
8 : #define ButtonInputTypes_h__
9 :
10 : #include "InputType.h"
11 :
12 : class ButtonInputTypeBase : public ::InputType
13 : {
14 : public:
15 0 : ~ButtonInputTypeBase() override {}
16 :
17 : protected:
18 0 : explicit ButtonInputTypeBase(mozilla::dom::HTMLInputElement* aInputElement)
19 0 : : InputType(aInputElement)
20 0 : {}
21 : };
22 :
23 : // input type=button
24 0 : class ButtonInputType : public ButtonInputTypeBase
25 : {
26 : public:
27 : static InputType*
28 0 : Create(mozilla::dom::HTMLInputElement* aInputElement, void* aMemory)
29 : {
30 0 : return new (aMemory) ButtonInputType(aInputElement);
31 : }
32 :
33 : private:
34 0 : explicit ButtonInputType(mozilla::dom::HTMLInputElement* aInputElement)
35 0 : : ButtonInputTypeBase(aInputElement)
36 0 : {}
37 : };
38 :
39 : // input type=image
40 0 : class ImageInputType : public ButtonInputTypeBase
41 : {
42 : public:
43 : static InputType*
44 0 : Create(mozilla::dom::HTMLInputElement* aInputElement, void* aMemory)
45 : {
46 0 : return new (aMemory) ImageInputType(aInputElement);
47 : }
48 :
49 : private:
50 0 : explicit ImageInputType(mozilla::dom::HTMLInputElement* aInputElement)
51 0 : : ButtonInputTypeBase(aInputElement)
52 0 : {}
53 : };
54 :
55 : // input type=reset
56 0 : class ResetInputType : public ButtonInputTypeBase
57 : {
58 : public:
59 : static InputType*
60 0 : Create(mozilla::dom::HTMLInputElement* aInputElement, void* aMemory)
61 : {
62 0 : return new (aMemory) ResetInputType(aInputElement);
63 : }
64 :
65 : private:
66 0 : explicit ResetInputType(mozilla::dom::HTMLInputElement* aInputElement)
67 0 : : ButtonInputTypeBase(aInputElement)
68 0 : {}
69 : };
70 :
71 : // input type=submit
72 0 : class SubmitInputType : public ButtonInputTypeBase
73 : {
74 : public:
75 : static InputType*
76 0 : Create(mozilla::dom::HTMLInputElement* aInputElement, void* aMemory)
77 : {
78 0 : return new (aMemory) SubmitInputType(aInputElement);
79 : }
80 :
81 : private:
82 0 : explicit SubmitInputType(mozilla::dom::HTMLInputElement* aInputElement)
83 0 : : ButtonInputTypeBase(aInputElement)
84 0 : {}
85 : };
86 :
87 : #endif /* ButtonInputTypes_h__ */
|