5#ifndef QQmlFormatOptions_P_H
6#define QQmlFormatOptions_P_H
19#include <QtCore/qstring.h>
20#include <QtQmlDom/private/qqmldomoutwriter_p.h>
21#include <QtQmlDom/private/qqmldomlinewriter_p.h>
22#include <QtQmlToolingSettings/private/qqmltoolingsettings_p.h>
49 return detectLineEndings(code);
51 return LineEndings::OldMacOs;
53 return LineEndings::Windows;
55 return LineEndings::Unix;
57 Q_UNREACHABLE_RETURN(LineEndings::Unix);
60 bool tabsEnabled()
const {
return m_options.formatOptions.useTabs; }
64 return m_options.attributesSequence == AttributesSequence::Normalize;
68 m_options.attributesSequence =
69 (normalize ? AttributesSequence::Normalize : AttributesSequence::Preserve);
76 int indentWidth()
const {
return m_options.formatOptions.indentSize; }
77 void setIndentWidth(
int width) { m_options.formatOptions.indentSize = width; }
81 QQmlJS::Dom::LineWriterOptions result = m_options;
82 result.lineEndings = lineEndings(m_newline, code);
92 void setFiles(
const QStringList &newFiles) { m_files = newFiles; }
94 void setArguments(
const QStringList &newArguments) { m_arguments = newArguments; }
108 m_writeDefaultSettings = newWriteDefaultSettings;
114 void addError(
const QString &newError) { m_errors.append(newError); };
119 QQmlJS::Dom::LineWriterOptions m_options;
124 QStringList m_arguments;
125 QStringList m_errors;
127 bool m_verbose =
false;
128 bool m_valid =
false;
129 bool m_inplace =
false;
130 bool m_force =
false;
131 bool m_ignoreSettings =
false;
132 bool m_writeDefaultSettings =
false;
133 bool m_indentWidthSet =
false;
Combined button and popup list for selecting options.