123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225 |
- /*
- * MIT License
- *
- * Copyright (c) 2019 Alexey Edelev <semlanik@gmail.com>, Tatyana Borisova <tanusshhka@mail.ru>
- *
- * This file is part of QtProtobuf project https://git.semlanik.org/semlanik/qtprotobuf
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this
- * software and associated documentation files (the "Software"), to deal in the Software
- * without restriction, including without limitation the rights to use, copy, modify,
- * merge, publish, distribute, sublicense, and/or sell copies of the Software, and
- * to permit persons to whom the Software is furnished to do so, subject to the following
- * conditions:
- *
- * The above copyright notice and this permission notice shall be included in all copies
- * or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
- * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
- * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
- #pragma once
- #include <unordered_map>
- #include <string>
- #include <google/protobuf/descriptor.h>
- namespace QtProtobuf {
- namespace generator {
- /*!
- * \ingroup generator
- * \private
- * \brief The Templates class
- */
- class Templates {
- public:
- static const std::vector<std::string> ListOfQmlExeptions;
- static const char *ProtoSufix;
- static const char *DefaultProtobufIncludesTemplate;
- static const char *QmlProtobufIncludesTemplate;
- static const char *GlobalEnumClassNameTemplate;
- static const char *PreambleTemplate;
- static const char *DisclaimerTemplate;
- static const char *InternalIncludeTemplate;
- static const char *ExternalIncludeTemplate;
- static const char *GlobalEnumIncludeTemplate;
- static const char *UsingQtProtobufNamespaceTemplate;
- static const char *ManualRegistrationDeclaration;
- static const char *ManualRegistrationComplexTypeDefinition;
- static const char *ManualRegistrationGlobalEnumDefinition;
- static const char *ComplexGlobalEnumFieldRegistrationTemplate;
- static const char *ComplexListTypeUsingTemplate;
- static const char *MapTypeUsingTemplate;
- static const char *MessageMapTypeUsingTemplate;
- static const char *NestedMessageUsingTemplate;
- static const char *EnumTypeRepeatedTemplate;
- static const char *NamespaceTemplate;
- static const char *UsingNamespaceTemplate;
- static const char *ClassDeclarationTemplate;
- static const char *ProtoClassForwardDeclarationTemplate;
- static const char *ProtoClassDeclarationBeginTemplate;
- static const char *ConstructorHeaderTemplate;
- static const char *ClassDefinitionTemplate;
- static const char *QObjectMacro;
- static const char *PropertyTemplate;
- static const char *RepeatedPropertyTemplate;
- static const char *RepeatedMessagePropertyTemplate;
- static const char *NonScriptablePropertyTemplate;
- static const char *NonScriptableAliasPropertyTemplate;
- static const char *MessagePropertyTemplate;
- static const char *QmlListPropertyTemplate;
- static const char *ConstructorParameterTemplate;
- static const char *ConstructorMessageParameterTemplate;
- static const char *ConstructorRepeatedParameterTemplate;
- static const char *ProtoConstructorBeginTemplate;
- static const char *ProtoConstructorEndTemplate;
- static const char *ConstructorParameterDefinitionTemplate;
- static const char *ConstructorMessageParameterDefinitionTemplate;
- static const char *ConstructorRepeatedParameterDefinitionTemplate;
- static const char *ProtoConstructorDefinitionBeginTemplate;
- static const char *ProtoConstructorDefinitionEndTemplate;
- static const char *MemberTemplate;
- static const char *ListMemberTemplate;
- static const char *ComplexMemberTemplate;
- static const char *PublicBlockTemplate;
- static const char *PrivateBlockTemplate;
- static const char *EnumDefinitionTemplate;
- static const char *EnumFieldTemplate;
- static const char *ConstructorTemplate;
- static const char *QObjectConstructorTemplate;
- static const char *CopyConstructorDeclarationTemplate;
- static const char *MoveConstructorDeclarationTemplate;
- static const char *CopyConstructorDefinitionTemplate;
- static const char *MoveConstructorDefinitionTemplate;
- static const char *EmptyCopyConstructorDefinitionTemplate;
- static const char *EmptyMoveConstructorDefinitionTemplate;
- static const char *DeletedCopyConstructorTemplate;
- static const char *DeletedMoveConstructorTemplate;
- static const char *CopyFieldTemplate;
- static const char *CopyComplexFieldTemplate;
- static const char *AssignComplexFieldTemplate;
- static const char *MoveMessageFieldTemplate;
- static const char *MoveAssignMessageFieldTemplate;
- static const char *MoveComplexFieldTemplate;
- static const char *MoveComplexFieldConstructorTemplate;
- static const char *MoveFieldTemplate;
- static const char *EnumMoveFieldTemplate;
- static const char *AssignmentOperatorDeclarationTemplate;
- static const char *AssignmentOperatorDefinitionTemplate;
- static const char *EmptyAssignmentOperatorDefinitionTemplate;
- static const char *AssignmentOperatorReturnTemplate;
- static const char *MoveAssignmentOperatorDeclarationTemplate;
- static const char *MoveAssignmentOperatorDefinitionTemplate;
- static const char *EmptyMoveAssignmentOperatorDefinitionTemplate;
- static const char *EqualOperatorDeclarationTemplate;
- static const char *EqualOperatorDefinitionTemplate;
- static const char *EmptyEqualOperatorDefinitionTemplate;
- static const char *EqualOperatorPropertyTemplate;
- static const char *EqualOperatorMessagePropertyTemplate;
- static const char *EqualOperatorRepeatedPropertyTemplate;
- static const char *NotEqualOperatorDeclarationTemplate;
- static const char *NotEqualOperatorDefinitionTemplate;
- static const char *GetterPrivateMessageDeclarationTemplate;
- static const char *GetterPrivateMessageDefinitionTemplate;
- static const char *GetterMessageDeclarationTemplate;
- static const char *GetterMessageDefinitionTemplate;
- static const char *GetterTemplate;
- static const char *NonScriptableGetterTemplate;
- static const char *GetterContainerExtraTemplate;
- static const char *GetterQmlListDeclarationTemplate;
- static const char *GetterQmlListDefinitionTemplate;
- static const char *SetterPrivateTemplateDeclarationMessageType;
- static const char *SetterPrivateTemplateDefinitionMessageType;
- static const char *SetterTemplateDeclarationMessageType;
- static const char *SetterTemplateDefinitionMessageType;
- static const char *SetterTemplateDeclarationComplexType;
- static const char *SetterTemplateDefinitionComplexType;
- static const char *SetterTemplate;
- static const char *NonScriptableSetterTemplate;
- static const char *SignalsBlockTemplate;
- static const char *SignalTemplate;
- static const char *FieldsOrderingContainerTemplate;
- static const char *FieldOrderTemplate;
- static const char *EnumTemplate;
- static const char *SimpleBlockEnclosureTemplate;
- static const char *SemicolonBlockEnclosureTemplate;
- static const char *EmptyBlockTemplate;
- static const char *PropertyInitializerTemplate;
- static const char *PropertyDefaultInitializerTemplate;
- static const char *MessagePropertyInitializerTemplate;
- static const char *MessagePropertyDefaultInitializerTemplate;
- static const char *ConstructorContentTemplate;
- static const char *DeclareMetaTypeTemplate;
- static const char *DeclareMetaTypeListTemplate;
- static const char *DeclareMessageMetaTypeTemplate;
- static const char *DeclareComplexListTypeTemplate;
- static const char *DeclareComplexQmlListTypeTemplate;
- static const char *DeclareMetaTypeMapTemplate;
- static const char *RegisterLocalEnumTemplate;
- static const char *RegisterMapTemplate;
- static const char *RegisterMetaTypeTemplate;
- static const char *RegisterGlobalEnumMetaTypeTemplate;
- static const char *RegisterMetaTypeTemplateNoNamespace;
- static const char *RegisterQmlListPropertyMetaTypeTemplate;
- static const char *QEnumTemplate;
- static const char *RegisterSerializersTemplate;
- static const char *RegisterEnumSerializersTemplate;
- static const char *RegistrarTemplate;
- static const char *EnumRegistrarTemplate;
- static const char *QmlRegisterTypeTemplate;
- static const char *QmlRegisterTypeUncreatableTemplate;
- static const char *QmlRegisterEnumTypeTemplate;
- //Service templates
- static const char *ClientConstructorDefinitionTemplate;
- static const char *ClientMethodDeclarationSyncTemplate;
- static const char *ClientMethodDeclarationAsyncTemplate;
- static const char *ClientMethodDeclarationAsync2Template;
- static const char *ClientMethodDeclarationQmlTemplate;
- static const char *ClientMethodDeclarationQml2Template;
- static const char *ServerMethodDeclarationTemplate;
- static const char *ClientMethodDefinitionSyncTemplate;
- static const char *ClientMethodDefinitionAsyncTemplate;
- static const char *ClientMethodDefinitionAsync2Template;
- static const char *ClientMethodDefinitionQmlTemplate;
- static const char *ClientMethodDefinitionQml2Template;
- //Streaming
- static const char *ClientMethodSignalDeclarationTemplate;
- static const char *ClientMethodServerStreamDeclarationTemplate;
- static const char *ClientMethodServerStream2DeclarationTemplate;
- static const char *ClientMethodServerStreamQmlDeclarationTemplate;
- static const char *ClientMethodServerStreamDefinitionTemplate;
- static const char *ClientMethodServerStream2DefinitionTemplate;
- static const char *ClientMethodServerStreamQmlDefinitionTemplate;
- static const char *ListSuffix;
- static const char *ProtoFileSuffix;
- static const char *GrpcFileSuffix;
- static const char *EnumClassSuffix;
- static const std::unordered_map<::google::protobuf::FieldDescriptor::Type, std::string> TypeReflection;
- static const char *QtProtobufNamespace;
- static const char *QtProtobufNestedNamespace;
- static const char *FieldEnumTemplate;
- static const char *FieldNumberTemplate;
- static const char *QtProtobufFieldEnum;
- };
- } //namespace generator
- } //namespace QtProtobuf
|