LibreOffice Module basic (master)
1
include
basic
codecompletecache.hxx
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
* This file is part of the LibreOffice project.
4
*
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/.
8
*
9
* This file incorporates work covered by the following license notice:
10
*
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 .
18
*/
19
20
#ifndef INCLUDED_BASIC_CODECOMPLETECACHE_HXX
21
#define INCLUDED_BASIC_CODECOMPLETECACHE_HXX
22
23
#include <config_options.h>
24
#include <
basic/basicdllapi.h
>
25
#include <rtl/ustring.hxx>
26
#include <unordered_map>
27
28
typedef
std::unordered_map< OUString, OUString >
CodeCompleteVarTypes
;
29
/* variable name, type */
30
typedef
std::unordered_map< OUString, CodeCompleteVarTypes >
CodeCompleteVarScopes
;
31
/* procedure, CodeCompleteVarTypes */
32
33
class
BASIC_DLLPUBLIC
CodeCompleteOptions
34
{
35
/*
36
* class to store basic code completion
37
* options
38
* */
39
private
:
40
bool
bIsCodeCompleteOn
;
41
bool
bIsProcedureAutoCompleteOn
;
42
bool
bIsAutoCloseQuotesOn
;
43
bool
bIsAutoCloseParenthesisOn
;
44
bool
bIsAutoCorrectOn
;
45
bool
bExtendedTypeDeclarationOn
;
46
47
public
:
48
CodeCompleteOptions
();
49
50
static
bool
IsCodeCompleteOn();
51
static
void
SetCodeCompleteOn(
bool
b );
52
53
static
bool
IsExtendedTypeDeclaration();
54
static
void
SetExtendedTypeDeclaration(
bool
b );
55
56
static
bool
IsProcedureAutoCompleteOn();
57
static
void
SetProcedureAutoCompleteOn(
bool
b );
58
59
static
bool
IsAutoCloseQuotesOn();
60
static
void
SetAutoCloseQuotesOn(
bool
b );
61
62
static
bool
IsAutoCloseParenthesisOn();
63
static
void
SetAutoCloseParenthesisOn(
bool
b );
64
65
static
bool
IsAutoCorrectOn();
66
static
void
SetAutoCorrectOn(
bool
b );
67
};
68
69
class
UNLESS_MERGELIBS(BASIC_DLLPUBLIC) CodeCompleteDataCache final
70
{
71
/*
72
* cache to store data for
73
* code completion
74
* */
75
private
:
76
CodeCompleteVarScopes
aVarScopes;
77
CodeCompleteVarTypes
aGlobalVars;
78
79
public
:
80
CodeCompleteDataCache(){}
81
82
friend
BASIC_DLLPUBLIC
std::ostream&
operator<<
(std::ostream& aStream,
const
CodeCompleteDataCache& aCache);
83
84
void
InsertGlobalVar(
const
OUString& sVarName,
const
OUString& sVarType );
85
void
InsertLocalVar(
const
OUString& sProcName,
const
OUString& sVarName,
const
OUString& sVarType );
86
OUString GetVarType( std::u16string_view sVarName )
const
;
87
OUString GetCorrectCaseVarName( std::u16string_view sVarName, std::u16string_view sActProcName )
const
;
88
void
Clear
();
89
};
90
91
#endif
// INCLUDED_BASIC_CODECOMPLETECACHE_HXX
92
93
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
basicdllapi.h
BASIC_DLLPUBLIC
#define BASIC_DLLPUBLIC
Definition:
basicdllapi.h:17
CodeCompleteOptions
Definition:
codecompletecache.hxx:34
CodeCompleteOptions::bIsAutoCloseParenthesisOn
bool bIsAutoCloseParenthesisOn
Definition:
codecompletecache.hxx:43
CodeCompleteOptions::bExtendedTypeDeclarationOn
bool bExtendedTypeDeclarationOn
Definition:
codecompletecache.hxx:45
CodeCompleteOptions::bIsCodeCompleteOn
bool bIsCodeCompleteOn
Definition:
codecompletecache.hxx:40
CodeCompleteOptions::bIsAutoCloseQuotesOn
bool bIsAutoCloseQuotesOn
Definition:
codecompletecache.hxx:42
CodeCompleteOptions::bIsAutoCorrectOn
bool bIsAutoCorrectOn
Definition:
codecompletecache.hxx:44
CodeCompleteOptions::bIsProcedureAutoCompleteOn
bool bIsProcedureAutoCompleteOn
Definition:
codecompletecache.hxx:41
operator<<
std::ostream & operator<<(std::ostream &aStream, const CodeCompleteDataCache &aCache)
Definition:
codecompletecache.cxx:104
CodeCompleteVarScopes
std::unordered_map< OUString, CodeCompleteVarTypes > CodeCompleteVarScopes
Definition:
codecompletecache.hxx:30
CodeCompleteVarTypes
std::unordered_map< OUString, OUString > CodeCompleteVarTypes
Definition:
codecompletecache.hxx:28
Clear
void Clear(EHistoryType eHistory)
Generated on Sun Jul 30 2023 04:39:11 for LibreOffice Module basic (master) by
1.9.3